diff --git a/.gitignore b/.gitignore index 7356be9..e9a6f66 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ wireshark-1.2.10.tar.bz2 /wireshark-1.10.7.tar.bz2 /wireshark-1.10.8.tar.bz2 /wireshark-1.10.9.tar.bz2 +/wireshark-1.12.0.tar.bz2 diff --git a/sources b/sources index 2620dbc..6881c00 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c8f0bf0f5bff39ae4ad0a48e41585cd2 wireshark-1.10.9.tar.bz2 +8dcfe451d8769901129809d2e19c1fb7 wireshark-1.12.0.tar.bz2 diff --git a/wireshark-0001-enable-Lua-support.patch b/wireshark-0001-enable-Lua-support.patch index 1daa4ba..0ffdc32 100644 --- a/wireshark-0001-enable-Lua-support.patch +++ b/wireshark-0001-enable-Lua-support.patch @@ -4,7 +4,7 @@ Subject: [PATCH] enable Lua support diff --git a/epan/wslua/template-init.lua b/epan/wslua/template-init.lua -index e6ec4ae..2538c4c 100644 +index 3fe2aca..2b48f9b 100644 --- a/epan/wslua/template-init.lua +++ b/epan/wslua/template-init.lua @@ -43,7 +43,7 @@ if running_superuser then diff --git a/wireshark-0002-Customize-permission-denied-error.patch b/wireshark-0002-Customize-permission-denied-error.patch index 8d706a5..1975ab8 100644 --- a/wireshark-0002-Customize-permission-denied-error.patch +++ b/wireshark-0002-Customize-permission-denied-error.patch @@ -8,10 +8,10 @@ because of permissions. Signed-off-by: Jan Safranek diff --git a/capture_sync.c b/capture_sync.c -index 391aa6a..6dfe1de 100644 +index 2f9d2cc..b18e47f 100644 --- a/capture_sync.c +++ b/capture_sync.c -@@ -368,6 +368,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session) +@@ -374,6 +374,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi gchar *signal_pipe_name; #else char errmsg[1024+1]; @@ -19,7 +19,7 @@ index 391aa6a..6dfe1de 100644 int sync_pipe[2]; /* pipe used to send messages from child to parent */ enum PIPES { PIPE_READ, PIPE_WRITE }; /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */ #endif -@@ -638,8 +639,11 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session) +@@ -649,8 +650,11 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi dup2(sync_pipe[PIPE_WRITE], 2); ws_close(sync_pipe[PIPE_READ]); execv(argv[0], argv); @@ -33,7 +33,7 @@ index 391aa6a..6dfe1de 100644 sync_pipe_errmsg_to_parent(2, errmsg, ""); /* Exit with "_exit()", so that we don't close the connection -@@ -731,6 +735,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd, +@@ -745,6 +749,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd, PROCESS_INFORMATION pi; #else char errmsg[1024+1]; @@ -41,7 +41,7 @@ index 391aa6a..6dfe1de 100644 int sync_pipe[2]; /* pipe used to send messages from child to parent */ int data_pipe[2]; /* pipe used to send data from child to parent */ #endif -@@ -865,8 +870,11 @@ sync_pipe_open_command(char** argv, int *data_read_fd, +@@ -879,8 +884,11 @@ sync_pipe_open_command(char** argv, int *data_read_fd, ws_close(sync_pipe[PIPE_READ]); ws_close(sync_pipe[PIPE_WRITE]); execv(argv[0], argv); diff --git a/wireshark-0003-Load-correct-shared-object-name-in-python.patch b/wireshark-0003-Load-correct-shared-object-name-in-python.patch deleted file mode 100644 index 0d05e05..0000000 --- a/wireshark-0003-Load-correct-shared-object-name-in-python.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Jan Safranek -Date: Thu, 9 Jun 2011 14:56:59 +0200 -Subject: [PATCH] Load correct shared object name in python. - -This fixes following error message shown by wireshark/tshark when wireshark-devel -was not installed: - libwireshark.so: cannot open shared object file: No such file or directory - -diff --git a/epan/wspython/wspy_libws.py b/epan/wspython/wspy_libws.py -index a293a17..0c528e4 100755 ---- a/epan/wspython/wspy_libws.py -+++ b/epan/wspython/wspy_libws.py -@@ -35,7 +35,7 @@ def get_libws_libname(): - elif system == "Windows": - return 'libwireshark.dll' - else: -- return 'libwireshark.so' -+ return 'libwireshark.so.3' - - def get_libws_handle(): - global __libwireshark diff --git a/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch new file mode 100644 index 0000000..796f4f9 --- /dev/null +++ b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch @@ -0,0 +1,18 @@ +From: Peter Hatina +Date: Wed, 4 Sep 2013 10:03:57 +0200 +Subject: [PATCH] fix string overrun in plugins/profinet + + +diff --git a/plugins/profinet/packet-dcom-cba.c b/plugins/profinet/packet-dcom-cba.c +index 0f1658a..f7fd322 100644 +--- a/plugins/profinet/packet-dcom-cba.c ++++ b/plugins/profinet/packet-dcom-cba.c +@@ -557,7 +557,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) + { + guint32 u32Pointer; +- gchar szStr[1000]; ++ gchar szStr[1000] = ""; + guint32 u32MaxStr = sizeof(szStr); + gchar *call; + diff --git a/wireshark-0004-adds-autoconf-macro-file.patch b/wireshark-0004-adds-autoconf-macro-file.patch new file mode 100644 index 0000000..5c1818d --- /dev/null +++ b/wireshark-0004-adds-autoconf-macro-file.patch @@ -0,0 +1,113 @@ +From: =?UTF-8?q?Radek=20Vok=C3=A1l?= +Date: Mon, 21 Dec 2009 11:19:39 +0000 +Subject: [PATCH] adds autoconf macro file + +updated autoconf macros and pkgconfig file in wireshark-devel to reflect current config.h Resolves: #746655 + +diff --git a/wireshark-autoconf.m4 b/wireshark-autoconf.m4 +new file mode 100644 +index 0000000..d8015d8 +--- /dev/null ++++ b/wireshark-autoconf.m4 +@@ -0,0 +1,101 @@ ++dnl AM_PATH_WIRESHARK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) ++dnl Test for wireshark development files, and define WIRESHARK_CFLAGS, ++dnl WIRESHARK_LIBS and WIRESHARK_VERSION. ++dnl ++AC_DEFUN([AM_PATH_WIRESHARK],[ ++ AC_ARG_WITH(wireshark-prefix, ++ [ --with-wireshark-prefix=PFX Prefix where wireshark libraries are installed (optional)], ++ wireshark_config_prefix="$withval", wireshark_config_prefix="") ++ ++ wireshark_found=no ++ if test "$wireshark_config_prefix" != "" ; then ++ AM_PATH_GLIB_2_0(,,,[gmodule]) ++ WIRESHARK_CFLAGS="-DWS_VAR_IMPORT=extern -DWS_MSVC_NORETURN= -I$wireshark_config_prefix/include/wireshark -I$wireshark_config_prefix/include/wireshark/epan -I/usr/include/wireshark -I/usr/include/wireshark/epan $GLIB_CFLAGS" ++ WIRESHARK_LIBS="-L$wireshark_config_prefix/lib -lwireshark -lwiretap $GLIB_LIBS" ++ wireshark_found=yes ++ else ++ PKG_PROG_PKG_CONFIG() ++ PKG_CHECK_MODULES(WIRESHARK, wireshark, wireshark_found=yes) ++ fi ++ ++ ac_save_CFLAGS="$CFLAGS" ++ ac_save_CLIBS="$LIBS" ++ CFLAGS="$CFLAGS $WIRESHARK_CFLAGS" ++ LIBS="$WIRESHARK_LIBS $LIBS" ++ min_wireshark_version=ifelse([$1], ,0.0.0,[$1]) ++ if test $wireshark_found = yes; then ++ AC_MSG_CHECKING(for wireshark version >= $min_wireshark_version) ++ wireshark_found=no ++ AC_TRY_RUN([ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int ++main() ++ ++{ ++ int ws_major_version, ws_minor_version, ws_micro_version; ++ int major, minor, micro; ++ char **tmp_version; ++ ++ tmp_version = (char *) strdup("$min_wireshark_version"); ++ major = 0; ++ minor = 0; ++ micro = 0; ++ sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ); ++ free(tmp_version); ++ tmp_version = (char *) epan_get_version(); ++ sscanf(tmp_version, "%d.%d.%d", ++ &ws_major_version, &ws_minor_version, &ws_micro_version); ++ ++ if (ws_major_version > major || ++ (ws_major_version == major && ws_minor_version > minor) || ++ (ws_major_version == major && ws_minor_version == minor && ++ ws_micro_version >= micro)) ++ return 0; ++ ++ printf("\n*** An old version of wireshark (%d.%d.%d) was found.\n", ++ ws_major_version, ws_minor_version, ws_micro_version); ++ printf("*** You need a version of wireshark not older than %d.%d.%d. ", ++ major, minor, micro); ++ return 1; ++} ++ ], wireshark_found=yes) ++ fi ++ ++ if test "$wireshark_found" != no; then ++ AC_LANG_PUSH(C) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([ ++#include ++#include ++#include ++#include ++#include ++#include ++], [puts(epan_get_version());])], [WIRESHARK_VERSION=`./conftest$ac_exeext`], ++wireshark_found=no) ++ ++ AC_LANG_POP ++ fi ++ ++ CFLAGS="$ac_save_CFLAGS" ++ LIBS="$ac_save_LIBS" ++ ++ if test "$wireshark_found" != no; then ++ AC_MSG_RESULT(yes) ++ ifelse([$2],, :, [$2]) ++ else ++ AC_MSG_RESULT(no) ++ WIRESHARK_CFLAGS="" ++ WIRESHARK_LIBS="" ++ WIRESHARK_VERSION="" ++ ifelse([$3], , :, [$3]) ++ fi ++ AC_SUBST(WIRESHARK_CFLAGS) ++ AC_SUBST(WIRESHARK_LIBS) ++ AC_SUBST(WIRESHARK_VERSION) ++]) diff --git a/wireshark-0004-fix-documentation-build-error.patch b/wireshark-0004-fix-documentation-build-error.patch deleted file mode 100644 index 365633c..0000000 --- a/wireshark-0004-fix-documentation-build-error.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Peter Hatina -Date: Mon, 8 Apr 2013 13:03:24 +0200 -Subject: [PATCH] fix documentation build error - - -diff --git a/doc/asn2deb.pod b/doc/asn2deb.pod -index 0d88a95..fb25349 100644 ---- a/doc/asn2deb.pod -+++ b/doc/asn2deb.pod -@@ -1,3 +1,4 @@ -+=encoding utf8 - - =head1 NAME - -diff --git a/doc/idl2deb.pod b/doc/idl2deb.pod -index 7daa798..82e933a 100644 ---- a/doc/idl2deb.pod -+++ b/doc/idl2deb.pod -@@ -1,3 +1,4 @@ -+=encoding utf8 - - =head1 NAME - diff --git a/wireshark-0005-Restore-Fedora-specific-groups.patch b/wireshark-0005-Restore-Fedora-specific-groups.patch new file mode 100644 index 0000000..b9f4b76 --- /dev/null +++ b/wireshark-0005-Restore-Fedora-specific-groups.patch @@ -0,0 +1,16 @@ +From: Peter Lemenkov +Date: Fri, 13 Sep 2013 14:36:55 +0400 +Subject: [PATCH] Restore Fedora-specific groups + +Signed-off-by: Peter Lemenkov + +diff --git a/wireshark.desktop b/wireshark.desktop +index 9e3ddcd..828eca7 100644 +--- a/wireshark.desktop ++++ b/wireshark.desktop +@@ -75,4 +75,4 @@ Terminal=false + MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view; + # Category entry according to: + # http://standards.freedesktop.org/menu-spec/1.0/ +-Categories=System;Monitor;GTK; ++Categories=Application;Network;GTK; diff --git a/wireshark-0005-fix-string-overrun-in-plugins-profinet.patch b/wireshark-0005-fix-string-overrun-in-plugins-profinet.patch deleted file mode 100644 index bb4268d..0000000 --- a/wireshark-0005-fix-string-overrun-in-plugins-profinet.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Peter Hatina -Date: Wed, 4 Sep 2013 10:03:57 +0200 -Subject: [PATCH] fix string overrun in plugins/profinet - - -diff --git a/plugins/profinet/packet-dcom-cba.c b/plugins/profinet/packet-dcom-cba.c -index b44caed..396de82 100644 ---- a/plugins/profinet/packet-dcom-cba.c -+++ b/plugins/profinet/packet-dcom-cba.c -@@ -553,7 +553,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *tree, guint8 *drep) - { - guint32 u32Pointer; -- gchar szStr[1000]; -+ gchar szStr[1000] = ""; - guint32 u32MaxStr = sizeof(szStr); - dcerpc_info *info = (dcerpc_info *) pinfo->private_data; - gchar *call; diff --git a/wireshark-0006-Add-pkgconfig-entry.patch b/wireshark-0006-Add-pkgconfig-entry.patch new file mode 100644 index 0000000..1922851 --- /dev/null +++ b/wireshark-0006-Add-pkgconfig-entry.patch @@ -0,0 +1,59 @@ +From: =?UTF-8?q?Radek=20Vok=C3=A1l?= +Date: Thu, 17 Dec 2009 09:17:07 +0000 +Subject: [PATCH] Add pkgconfig entry + + +diff --git a/Makefile.am b/Makefile.am +index c60d873..40a6e4d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -53,6 +53,9 @@ EXTRA_PROGRAMS = wireshark wireshark-qt tshark tfshark capinfos captype editcap + mergecap dftest randpkt text2pcap dumpcap reordercap rawshark \ + wireshark_cxx echld_test + ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = wireshark.pc ++ + # + # Wireshark configuration files are put in $(pkgdatadir). + # +diff --git a/configure.ac b/configure.ac +index 20eb3b3..8c9b79c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2779,6 +2779,7 @@ AC_CONFIG_HEADERS(config.h) + AC_OUTPUT( + Makefile + doxygen.cfg ++ wireshark.pc + asn1/Makefile + _CUSTOM_ASN1_AC_OUTPUT_ + asn1/acp133/Makefile +diff --git a/wireshark.pc.in b/wireshark.pc.in +index 91bf28b..2e2fcdc 100644 +--- a/wireshark.pc.in ++++ b/wireshark.pc.in +@@ -1,14 +1,11 @@ +-prefix=@CMAKE_INSTALL_PREFIX@ +-exec_prefix=${prefix} +-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +-sharedlibdir=${libdir} +-includedir=${prefix}/include/wireshark +-plugindir=@PLUGIN_INSTALL_DIR@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ + + Name: wireshark +-Description: wireshark network packet dissection library +-Version: @PROJECT_VERSION@ +- +-Requires: +-Libs: -L${libdir} -L${sharedlibdir} -lwireshark +-Cflags: -I${includedir} ++Description: Network Traffic Analyzer ++Version: @PACKAGE_VERSION@ ++Requires: glib-2.0 gmodule-2.0 ++Libs: -L@libdir@ -lwireshark -lwiretap ++Cflags: -DWS_VAR_IMPORT=extern -DHAVE_STDARG_H -DWS_MSVC_NORETURN= -I@includedir@/wireshark -I@includedir@/wireshark/epan diff --git a/wireshark-0006-From-Peter-Lemenkov-via-https-bugs.wireshark.org-bug.patch b/wireshark-0006-From-Peter-Lemenkov-via-https-bugs.wireshark.org-bug.patch deleted file mode 100644 index 5a27ecf..0000000 --- a/wireshark-0006-From-Peter-Lemenkov-via-https-bugs.wireshark.org-bug.patch +++ /dev/null @@ -1,1639 +0,0 @@ -From: Evan Huus -Date: Sun, 18 Aug 2013 19:49:08 +0000 -Subject: [PATCH] Dissector for the Sippy RTPproxy controlling protocol - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8326 - -Dissector for the Sippy RTPproxy controlling protocol. RTPproxy is a well-known -(among SIP-engineers) application and it operates using its own simple -text-based protocol. There are several competing products but all of them -implements it (sometimes slightly extending). - -svn path=/trunk/; revision=51417 - -Add a cast to try and fix -packet-rtpproxy.c:226: warning: implicit conversion shortens 64-bit value into -a 32-bit value - -I'm not quite sure what's going on here, all the values in use are either gint -or guint so they should all be the same size? - -svn path=/trunk/; revision=51419 - -Take another stab at -packet-rtpproxy.c:226: warning: implicit conversion shortens 64-bit value into a -32-bit value - -svn path=/trunk/; revision=51420 - -One more 64/32-conversion fix for rtpproxy - -svn path=/trunk/; revision=51421 - -Fix Coverity CID 1063335: Unused pointer value. - -svn path=/trunk/; revision=51430 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9211 : -Add basic conversation support for rtpproxy dissector - -svn path=/trunk/; revision=52331 - -Let's please fix-encoding-args.pl - -svn path=/trunk/; revision=52334 - -Make RTPProxy a newstyle dissector. - -svn path=/trunk/; revision=52476 - -Try to fix -packet-rtpproxy.c:217: warning: comparison between signed and unsigned - -svn path=/trunk/; revision=52477 - -Fix signed vs. unsigned comparison warnings. - -svn path=/trunk/; revision=52483 - -Add response time to the rtpproxy dissector. Bug 9380 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9380) - -From Peter Lemenkov. - -svn path=/trunk/; revision=53115 - -Decode more error replies in RTPproxy dissector. Bug 9408 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9408) - -From Peter Lemenkov - -svn path=/trunk/; revision=53245 - -From Peter Lemenkov -display a text description for the RTPProxy version request - -https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9416 - -svn path=/trunk/; revision=53249 - -replace proto_tree_add_string_format_value() with proto_tree_add_item() - -svn path=/trunk/; revision=53261 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9429 : -Fix Notify info parsing in RTPproxy dissector - -svn path=/trunk/; revision=53385 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9430 : -Fix empty ToTag in RTPproxy's Offer/Update command - -svn path=/trunk/; revision=53391 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9440 : -RTPproxy: use proto_item_append_text instead of rewriting the entire item's text - -svn path=/trunk/; revision=53393 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9441 : -Fix Notify IPv6 address parsing in RTPproxy dissector - -svn path=/trunk/; revision=53394 - -add a cast to fix compiler warning - -svn path=/trunk/; revision=53401 - -Fix typo errors - -svn path=/trunk/; revision=53585 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9397 : -Add RTP/RTCP dissector setup based on the replies found in rtpproxy dissector - -svn path=/trunk/; revision=53603 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9444 : -Add initial parameter parser for commands in RTPproxy dissector - -svn path=/trunk/; revision=53604 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9476 : -Add DTMF dissector setup based on the information found in RTPproxy requests - -svn path=/trunk/; revision=53605 - -Squelch a compiler warning. - -svn path=/trunk/; revision=53606 - -Reinitialize counter between loops to avoid an out of bound access found with fuzz testing. - -svn path=/trunk/; revision=53612 - -RTPproxy dissector: Add expert info about timeouts. Bug 9484 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9484) - -From Peter Lemenkov - -svn path=/trunk/; revision=53622 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9487 : -Use RTP payload descriptions from RTP dissector in RTPproxy codec param value - -svn path=/trunk/; revision=53658 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9490 : -Couple packets in RTPproxy dissector not only with CookieID but also with Call-IDs - -svn path=/trunk/; revision=53673 - -Fix Coverity CID 1134045: Printf format string issue. (As documented in the printf man page for the ' option, "Note that many versions of gcc(1) cannot parse this option and will issue a warning." (r47940 reverted a similar change, so this keeps things consistent.) - -svn path=/trunk/; revision=53705 - -Clean up indentation. - -svn path=/trunk/; revision=53742 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9556 - -Cosmetic change in a LF field representation in the RTPproxy dissector - -Don't display any value for LF field - -Signed-off-by: Peter Lemenkov - -svn path=/trunk/; revision=54045 - -From Peter Lemenkov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9558 - -Mark generated fields as generated in RTPproxy dissector - -This patch is cosmetic. It just marks generated fields as generated (to avoid confusion) - -Signed-off-by: Peter Lemenkov - -svn path=/trunk/; revision=54123 - -From Peter Lemenkov: - - "This patch removes misleading dereferencing operator from the - array's name. E.g. consider the following declaration: - - guint32 ipaddr[4]; - - ipaddr points to the address of an array of guint32's, while &ipaddr - points to the first' guint32 object. E.g. &ipaddr == &ipaddr[0]. The - value is the same, but has different type which is necessary - sometimes. However inet_pton treats latest argument as void*, and - this information is left anyway. So no need to bother with types and - let's just pass pointer to the array." - - https://bugs.wireshark.org/bugzilla/attachment.cgi?id=12304 - -From me: Remove dereferencing operator from 'ipaddr' in two calls to - wmem_memdup(). - -svn path=/trunk/; revision=54156 - -Add numeric types instead of string where possible in the RTPproxy dissector. Bug 9561 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9561) - -From Peter Lemenkov - -svn path=/trunk/; revision=54467 - -diff --git a/AUTHORS b/AUTHORS -index 10782b0..e7b3c18 100644 ---- a/AUTHORS -+++ b/AUTHORS -@@ -3733,6 +3733,7 @@ Max Baker - Mike Garratt - Bart Van Assche - Karl Beldan -+Peter Lemenkov - Masayuki Takemura - - -diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt -index c5c1193..9c547b3 100644 ---- a/epan/CMakeLists.txt -+++ b/epan/CMakeLists.txt -@@ -1083,6 +1083,7 @@ set(DISSECTOR_SRC - dissectors/packet-rtp-events.c - dissectors/packet-rtp-midi.c - dissectors/packet-rtp.c -+ dissectors/packet-rtpproxy.c - dissectors/packet-rtps.c - dissectors/packet-rtsp.c - dissectors/packet-rudp.c -diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common -index 937f522..73217d7 100644 ---- a/epan/dissectors/Makefile.common -+++ b/epan/dissectors/Makefile.common -@@ -1004,6 +1004,7 @@ DISSECTOR_SRC = \ - packet-rtp-events.c \ - packet-rtp-midi.c \ - packet-rtp.c \ -+ packet-rtpproxy.c \ - packet-rtps.c \ - packet-rtsp.c \ - packet-rudp.c \ -diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c -new file mode 100644 -index 0000000..e8c5c95 ---- /dev/null -+++ b/epan/dissectors/packet-rtpproxy.c -@@ -0,0 +1,1394 @@ -+/* packet-rtpproxy.c -+ * RTPproxy command protocol dissector -+ * Copyright 2013, Peter Lemenkov -+ * -+ * This dissector tries to dissect rtpproxy control protocol. Please visit this -+ * link for brief details on the command format: -+ * -+ * http://www.rtpproxy.org/wiki/RTPproxy/Protocol -+ * -+ * $Id$ -+ * -+ * Wireshark - Network traffic analyzer -+ * By Gerald Combs -+ * Copyright 1999 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 -+#include -+#include -+#include -+ -+#ifdef HAVE_ARPA_INET_H -+#include -+#endif -+#ifdef HAVE_WINSOCK2_H -+#include /* needed to define AF_ values on Windows */ -+#endif -+#ifdef NEED_INET_V6DEFS_H -+#include "wsutil/inet_v6defs.h" -+#endif -+ -+/* For setting up RTP/RTCP dissectors based on the RTPproxy's answers */ -+#include "packet-rtp.h" -+#include "packet-rtcp.h" -+ -+static int proto_rtpproxy = -1; -+ -+static int hf_rtpproxy_cookie = -1; -+static int hf_rtpproxy_error = -1; -+static int hf_rtpproxy_status = -1; -+static int hf_rtpproxy_ok = -1; -+static int hf_rtpproxy_ipv4 = -1; -+static int hf_rtpproxy_ipv6 = -1; -+static int hf_rtpproxy_port = -1; -+static int hf_rtpproxy_lf = -1; -+static int hf_rtpproxy_request = -1; -+static int hf_rtpproxy_command = -1; -+static int hf_rtpproxy_command_parameters = -1; -+static int hf_rtpproxy_command_parameter = -1; -+static int hf_rtpproxy_command_parameter_codec = -1; -+static int hf_rtpproxy_command_parameter_local = -1; -+static int hf_rtpproxy_command_parameter_remote = -1; -+static int hf_rtpproxy_command_parameter_repacketize = -1; -+static int hf_rtpproxy_command_parameter_dtmf = -1; -+/* static int hf_rtpproxy_command_parameter_cmap = -1; TODO */ -+static int hf_rtpproxy_command_parameter_proto = -1; -+static int hf_rtpproxy_command_parameter_transcode = -1; -+static int hf_rtpproxy_command_parameter_acc = -1; -+static int hf_rtpproxy_callid = -1; -+static int hf_rtpproxy_copy_target = -1; -+static int hf_rtpproxy_playback_filename = -1; -+static int hf_rtpproxy_playback_codec = -1; -+static int hf_rtpproxy_notify = -1; -+static int hf_rtpproxy_notify_ipv4 = -1; -+static int hf_rtpproxy_notify_ipv6 = -1; -+static int hf_rtpproxy_notify_port = -1; -+static int hf_rtpproxy_notify_tag = -1; -+static int hf_rtpproxy_tag = -1; -+static int hf_rtpproxy_mediaid = -1; -+static int hf_rtpproxy_reply = -1; -+static int hf_rtpproxy_version_request = -1; -+static int hf_rtpproxy_version_supported = -1; -+ -+/* Request/response tracking */ -+static int hf_rtpproxy_request_in = -1; -+static int hf_rtpproxy_response_in = -1; -+static int hf_rtpproxy_response_time = -1; -+ -+typedef struct _rtpproxy_info { -+ guint32 req_frame; -+ guint32 resp_frame; -+ nstime_t req_time; -+ gchar* callid; -+} rtpproxy_info_t; -+ -+static dissector_handle_t rtcp_handle; -+static dissector_handle_t rtp_events_handle; -+static dissector_handle_t rtp_handle; -+ -+typedef struct _rtpproxy_conv_info { -+ emem_tree_t *trans; -+} rtpproxy_conv_info_t; -+ -+ -+static const string_string versiontypenames[] = { -+ { "20040107", "Basic RTP proxy functionality" }, -+ { "20050322", "Support for multiple RTP streams and MOH" }, -+ { "20060704", "Support for extra parameter in the V command" }, -+ { "20071116", "Support for RTP re-packetization" }, -+ { "20071218", "Support for forking (copying) RTP stream" }, -+ { "20080403", "Support for RTP statistics querying" }, -+ { "20081102", "Support for setting codecs in the update/lookup command" }, -+ { "20081224", "Support for session timeout notifications" }, -+ { "20090810", "Support for automatic bridging" }, -+ { 0, NULL } -+}; -+ -+static const value_string commandtypenames[] = { -+ { 'V', "Handshake/Ping" }, -+ { 'v', "Handshake/Ping" }, -+ { 'U', "Offer/Update" }, -+ { 'u', "Offer/Update" }, -+ { 'L', "Answer/Lookup" }, -+ { 'l', "Answer/Lookup" }, -+ { 'I', "Information"}, -+ { 'i', "Information"}, -+ { 'X', "Close all active sessions"}, -+ { 'x', "Close all active sessions"}, -+ { 'D', "Delete an active session (Bye/Cancel/Error)"}, -+ { 'd', "Delete an active session (Bye/Cancel/Error)"}, -+ { 'P', "Start playback (music-on-hold)"}, -+ { 'p', "Start playback (music-on-hold)"}, -+ { 'S', "Stop playback (music-on-hold)"}, -+ { 's', "Stop playback (music-on-hold)"}, -+ { 'R', "Start recording"}, -+ { 'r', "Start recording"}, -+ { 'C', "Copy stream"}, -+ { 'c', "Copy stream"}, -+ { 'Q', "Query info about a session"}, -+ { 'q', "Query info about a session"}, -+ { 0, NULL } -+}; -+ -+static const value_string paramtypenames[] = { -+ /* Official command parameters */ -+ {'4', "Remote address is IPv4"}, -+ {'6', "Remote address is IPv6"}, -+ {'a', "Asymmetric RTP"}, -+ {'A', "Asymmetric RTP"}, -+ {'b', "Brief stats"}, -+ {'B', "Brief stats"}, -+ {'c', "Codecs"}, -+ {'C', "Codecs"}, -+ {'e', "External network (non RFC 1918)"}, -+ {'E', "External network (non RFC 1918)"}, -+ {'i', "Internal network (RFC 1918)"}, -+ {'I', "Internal network (RFC 1918)"}, -+ {'l', "Local address"}, -+ {'L', "Local address"}, -+ {'r', "Remote address"}, -+ {'R', "Remote address"}, -+ {'s', "Symmetric RTP (default)"}, -+ {'S', "Symmetric RTP (default)"}, -+ {'w', "Weak connection (allows roaming)"}, -+ {'W', "Weak connection (allows roaming)"}, -+ {'z', "repacketiZe"}, -+ {'Z', "repacketiZe"}, -+ /* Unofficial command parameters / expensions */ -+ {'d', "DTMF payload ID (unofficial extension)"}, -+ {'D', "DTMF payload ID (unofficial extension)"}, -+ {'m', "codec Mapping (unofficial extension)"}, -+ {'M', "codec Mapping (unofficial extension)"}, -+ {'p', "Protocol type (unofficial extension)"}, -+ {'P', "Protocol type (unofficial extension)"}, -+ {'t', "Transcode to (unofficial extension)"}, -+ {'T', "Transcode to (unofficial extension)"}, -+ {'v', "Accounting (unofficial extension)"}, -+ {'V', "Accounting (unofficial extension)"}, -+ {0, NULL} -+}; -+ -+static const value_string prototypenames[] = { -+ { '0', "UDP (default)"}, -+ { '1', "TCP"}, -+ { '2', "SCTP"}, -+ { 0, NULL } -+}; -+static const value_string acctypenames[] = { -+ { '0', "Start"}, -+ { '1', "Interim update"}, -+ { '2', "Stop"}, -+ { 0, NULL } -+}; -+ -+static const value_string oktypenames[] = { -+ { '0', "Ok"}, -+ { '1', "Version Supported"}, -+ { 0, NULL } -+}; -+ -+static const string_string errortypenames[] = { -+ { "E0", "Syntax error" }, -+ { "E1", "Syntax error" }, -+ { "E2", "Syntax error" }, -+ { "E3", "Unknown command" }, -+ { "E4", "Syntax error" }, -+ { "E5", "Out of memory" }, -+ { "E6", "" }, -+ { "E7", "Software error (can't create listener)" }, -+ { "E8", "Not Found" }, -+ { "E10", "Software error (can't create listener)" }, -+ { "E11", "Out of memory" }, -+ { "E12", "Out of memory" }, -+ { "E13", "Out of memory" }, -+ { "E14", "Out of memory" }, -+ { 0, NULL } -+}; -+ -+static gint ett_rtpproxy = -1; -+ -+static gint ett_rtpproxy_request = -1; -+static gint ett_rtpproxy_command = -1; -+static gint ett_rtpproxy_command_parameters = -1; -+static gint ett_rtpproxy_command_parameters_codecs = -1; -+static gint ett_rtpproxy_command_parameters_local = -1; -+static gint ett_rtpproxy_command_parameters_remote = -1; -+static gint ett_rtpproxy_command_parameters_repacketize = -1; -+static gint ett_rtpproxy_command_parameters_dtmf = -1; -+static gint ett_rtpproxy_command_parameters_cmap = -1; -+static gint ett_rtpproxy_command_parameters_proto = -1; -+static gint ett_rtpproxy_command_parameters_transcode = -1; -+static gint ett_rtpproxy_command_parameters_acc = -1; -+static gint ett_rtpproxy_tag = -1; -+static gint ett_rtpproxy_notify = -1; -+ -+static gint ett_rtpproxy_reply = -1; -+ -+/* Default values */ -+static guint rtpproxy_tcp_port = 22222; -+static guint rtpproxy_udp_port = 22222; -+static gboolean rtpproxy_establish_conversation = TRUE; -+/* See - http://www.opensips.org/html/docs/modules/1.11.x/rtpproxy.html#id250018 */ -+/* See - http://www.kamailio.org/docs/modules/devel/modules/rtpproxy.html#idm448 */ -+static guint rtpproxy_timeout = 1000; -+static nstime_t rtpproxy_timeout_ns = {1, 0}; -+ -+void proto_reg_handoff_rtpproxy(void); -+ -+gint -+rtpproxy_add_tag(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, guint realsize) -+{ -+ proto_item *ti = NULL; -+ proto_tree *another_tree = NULL; -+ gint new_offset; -+ guint end; -+ -+ new_offset = tvb_find_guint8(tvb, begin, -1, ' '); -+ if(new_offset < 0) -+ end = realsize; /* No more parameters */ -+ else -+ end = new_offset; -+ -+ /* SER/OpenSER/OpenSIPS/Kamailio adds Media-ID right after the Tag -+ * separated by a semicolon -+ */ -+ new_offset = tvb_find_guint8(tvb, begin, end, ';'); -+ if(new_offset == -1){ -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_tag, tvb, begin, end - begin, ENC_ASCII | ENC_NA); -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_tag); -+ ti = proto_tree_add_item(another_tree, hf_rtpproxy_mediaid, tvb, new_offset+1, 0, ENC_ASCII | ENC_NA); -+ proto_item_append_text(ti, ""); -+ PROTO_ITEM_SET_GENERATED(ti); -+ } -+ else{ -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_tag, tvb, begin, new_offset - begin, ENC_ASCII | ENC_NA); -+ if ((guint)new_offset == begin){ -+ proto_item_append_text(ti, ""); /* A very first Offer/Update command */ -+ PROTO_ITEM_SET_GENERATED(ti); -+ } -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_tag); -+ proto_tree_add_item(another_tree, hf_rtpproxy_mediaid, tvb, new_offset+1, end - (new_offset+1), ENC_ASCII | ENC_NA); -+ } -+ return (end == realsize ? -1 : (gint)end); -+} -+ -+void -+rtpproxy_add_parameter(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, guint realsize) -+{ -+ proto_item *ti; -+ proto_tree *another_tree = NULL; -+ guint offset = 0; -+ guint new_offset = 0; -+ gint i; -+ guint pt = 0; -+ gchar** codecs = NULL; -+ guint codec_len; -+ guint8* rawstr = NULL; -+ -+ /* Extract the entire parameters line. */ -+ /* Something like "t4p1iic8,0,2,4,18,96,97,98,100,101" */ -+ rawstr = tvb_get_ephemeral_string(tvb, begin, realsize); -+ -+ while(offset < realsize){ -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_command_parameter, tvb, begin + offset, 1, ENC_NA); -+ offset++; /* Skip 1-byte parameter's type */ -+ switch (g_ascii_tolower(tvb_get_guint8(tvb, begin+offset-1))) -+ { -+ /* Official long parameters */ -+ case 'c': -+ new_offset = (gint)strspn(rawstr+offset, "0123456789,"); -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_codecs); -+ codecs = g_strsplit(tvb_get_ephemeral_string(tvb, begin+offset, new_offset), ",", 0); -+ i = 0; -+ while(codecs[i]){ -+ /* We assume strings < 2^32-1 bytes long. :-) */ -+ codec_len = (guint)strlen(codecs[i]); -+ ti = proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_codec, tvb, begin+offset, codec_len, -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, begin+offset, codec_len), NULL, 10)); -+ proto_item_append_text(ti, " (%s)", val_to_str_ext((guint)strtoul(tvb_format_text(tvb,begin+offset,codec_len),NULL,10), &rtp_payload_type_vals_ext, "Unknown")); -+ offset += codec_len; -+ if(codecs[i+1]) -+ offset++; /* skip comma */ -+ i++; -+ }; -+ g_strfreev(codecs); -+ break; -+ case 'l': -+ new_offset = (gint)strspn(rawstr+offset, "0123456789."); -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_local); -+ proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_local, tvb, begin+offset, new_offset, ENC_ASCII | ENC_NA); -+ offset += new_offset; -+ break; -+ case 'r': -+ new_offset = (gint)strspn(rawstr+offset, "0123456789."); -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_remote); -+ proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_remote, tvb, begin+offset, new_offset, ENC_ASCII | ENC_NA); -+ offset += new_offset; -+ break; -+ case 'z': -+ new_offset = (gint)strspn(rawstr+offset, "0123456789"); -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_repacketize); -+ proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_repacketize, tvb, begin+offset, new_offset, -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, begin+offset, new_offset), NULL, 10)); -+ offset += new_offset; -+ break; -+ /* Unofficial long parameters */ -+ case 'd': -+ new_offset = (gint)strspn(rawstr+offset, "0123456789"); -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_dtmf); -+ proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_dtmf, tvb, begin+offset, new_offset, -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, begin+offset, new_offset), NULL, 10)); -+ if(rtpproxy_establish_conversation){ -+ pt = (guint)strtoul(tvb_format_text(tvb,begin+offset,new_offset),NULL,10); -+ dissector_add_uint("rtp.pt", pt, rtp_events_handle); -+ } -+ offset += new_offset; -+ break; -+ case 'm': -+ new_offset = (gint)strspn(rawstr+offset, "0123456789=,"); -+ /* TODO */ -+ offset += new_offset; -+ break; -+ case 'p': -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_proto); -+ proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_proto, tvb, begin+offset, 1, ENC_NA); -+ offset++; -+ break; -+ case 't': -+ new_offset = (gint)strspn(rawstr+offset, "0123456789"); -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_transcode); -+ ti = proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_transcode, tvb, begin+offset, new_offset, -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, begin+offset, new_offset), NULL, 10)); -+ proto_item_append_text(ti, " (%s)", val_to_str_ext((guint)strtoul(tvb_format_text(tvb,begin+offset, new_offset),NULL,10), &rtp_payload_type_vals_ext, "Unknown")); -+ offset += new_offset; -+ break; -+ case 'v': -+ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_acc); -+ proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_acc, tvb, begin+offset, 1, ENC_NA); -+ offset++; -+ break; -+ default: -+ break; -+ } -+ } -+} -+ -+rtpproxy_info_t * -+rtpproxy_add_tid(gboolean is_request, tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_tree, rtpproxy_conv_info_t *rtpproxy_conv, gchar* cookie) -+{ -+ rtpproxy_info_t *rtpproxy_info; -+ proto_item *pi; -+ -+ if (!PINFO_FD_VISITED(pinfo)) { -+ if (is_request){ -+ rtpproxy_info = se_new(rtpproxy_info_t); -+ rtpproxy_info->req_frame = PINFO_FD_NUM(pinfo); -+ rtpproxy_info->resp_frame = 0; -+ rtpproxy_info->req_time = pinfo->fd->abs_ts; -+ rtpproxy_info->callid = NULL; -+ se_tree_insert_string(rtpproxy_conv->trans, cookie, rtpproxy_info, 0); -+ } else { -+ rtpproxy_info = (rtpproxy_info_t *)se_tree_lookup_string(rtpproxy_conv->trans, cookie, 0); -+ if (rtpproxy_info) { -+ rtpproxy_info->resp_frame = PINFO_FD_NUM(pinfo); -+ } -+ } -+ } else { -+ rtpproxy_info = (rtpproxy_info_t *)se_tree_lookup_string(rtpproxy_conv->trans, cookie, 0); -+ if (rtpproxy_info && (is_request ? rtpproxy_info->resp_frame : rtpproxy_info->req_frame)) { -+ nstime_t ns; -+ -+ pi = proto_tree_add_uint(rtpproxy_tree, is_request ? hf_rtpproxy_response_in : hf_rtpproxy_request_in, tvb, 0, 0, is_request ? rtpproxy_info->resp_frame : rtpproxy_info->req_frame); -+ PROTO_ITEM_SET_GENERATED(pi); -+ -+ /* If reply then calculate response time */ -+ if (!is_request){ -+ nstime_delta(&ns, &pinfo->fd->abs_ts, &rtpproxy_info->req_time); -+ pi = proto_tree_add_time(rtpproxy_tree, hf_rtpproxy_response_time, tvb, 0, 0, &ns); -+ PROTO_ITEM_SET_GENERATED(pi); -+ if (nstime_cmp(&rtpproxy_timeout_ns, &ns) < 0) -+ expert_add_info_format(pinfo, rtpproxy_tree, PI_RESPONSE_CODE, PI_WARN, "Response timeout %.3f seconds", nstime_to_sec(&ns)); -+ } -+ } -+ } -+ /* Could be NULL so we should check it before dereferencing */ -+ return rtpproxy_info; -+} -+ -+void -+rtpproxy_add_notify_addr(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, guint end) -+{ -+ gint offset = 0; -+ gint tmp = 0; -+ gboolean ipv6 = FALSE; -+ proto_item *ti; -+ -+ /* Check for at least one colon */ -+ offset = tvb_find_guint8(tvb, begin, end, ':'); -+ if(offset != -1){ -+ /* Find if it's the latest colon (not in case of a IPv6) */ -+ while((tmp = tvb_find_guint8(tvb, offset+1, end, ':')) != -1){ -+ ipv6 = TRUE; -+ offset = tmp; -+ } -+ /* We have ip:port */ -+ if(ipv6) -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, offset - begin, ENC_ASCII | ENC_NA); -+ else -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, offset - begin, ENC_ASCII | ENC_NA); -+ proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_notify_port, tvb, offset+1, end - (offset+1), -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, offset+1, end - (offset+1)), NULL, 10)); -+ } -+ else{ -+ /* Only port is supplied */ -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, 0, ENC_ASCII | ENC_NA); -+ proto_item_append_text(ti, ""); -+ PROTO_ITEM_SET_GENERATED(ti); -+ proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_notify_port, tvb, begin, end - begin, -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, begin, end - begin), NULL, 10)); -+ } -+} -+ -+static int -+dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) -+{ -+ gboolean has_lf = FALSE; -+ gint offset = 0; -+ gint new_offset = 0; -+ guint tmp; -+ gint realsize = 0; -+ guint8* rawstr; -+ guint8* tmpstr; -+ proto_item *ti; -+ proto_item *ti2; -+ proto_tree *rtpproxy_tree; -+ conversation_t *conversation; -+ rtpproxy_conv_info_t *rtpproxy_conv; -+ gchar* cookie = NULL; -+ /* For RT(C)P setup */ -+ address addr; -+ guint16 port; -+ guint32 ipaddr[4]; -+ rtpproxy_info_t *rtpproxy_info = NULL; -+ -+ /* If it does not start with a printable character it's not RTPProxy */ -+ if(!isprint(tvb_get_guint8(tvb, 0))) -+ return 0; -+ -+ /* Extract Cookie */ -+ offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ if(offset == -1) -+ return 0; -+ -+ /* Clear out stuff in the info column - we''l set it later */ -+ col_clear(pinfo->cinfo, COL_INFO); -+ -+ ti = proto_tree_add_item(tree, proto_rtpproxy, tvb, 0, -1, ENC_NA); -+ rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy); -+ -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_cookie, tvb, 0, offset, ENC_ASCII | ENC_NA); -+ cookie = tvb_get_ephemeral_string(tvb, 0, offset); -+ -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, offset+1, -1); -+ -+ /* Calculate size to prevent recalculation in the future */ -+ realsize = tvb_reported_length(tvb); -+ -+ -+ /* Check for LF (required for TCP connection, optional for UDP) */ -+ if (tvb_get_guint8(tvb, realsize - 1) == '\n'){ -+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPproxy"); -+ /* Don't count trailing LF */ -+ realsize -= 1; -+ has_lf = TRUE; -+ } -+ else -+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPproxy (no LF)"); -+ -+ -+ /* Try to create conversation */ -+ conversation = find_or_create_conversation(pinfo); -+ rtpproxy_conv = (rtpproxy_conv_info_t *)conversation_get_proto_data(conversation, proto_rtpproxy); -+ if (!rtpproxy_conv) { -+ rtpproxy_conv = se_new(rtpproxy_conv_info_t); -+ rtpproxy_conv->trans = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtpproxy transactions");; -+ conversation_add_proto_data(conversation, proto_rtpproxy, rtpproxy_conv); -+ } -+ -+ /* Get payload string */ -+ rawstr = tvb_get_ephemeral_string(tvb, offset, realsize - offset); -+ -+ /* Extract command */ -+ tmp = g_ascii_tolower(tvb_get_guint8(tvb, offset)); -+ switch (tmp) -+ { -+ case 's': -+ /* A specific case - long statistics answer */ -+ /* %COOKIE% sessions created %NUM0% active sessions: %NUM1% */ -+ rtpproxy_add_tid(FALSE, tvb, pinfo, rtpproxy_tree, rtpproxy_conv, cookie); -+ if ('e' == tvb_get_guint8(tvb, offset+1)){ -+ col_add_fstr(pinfo->cinfo, COL_INFO, "Reply: %s", rawstr); -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_reply, tvb, offset, -1, ENC_NA); -+ -+ rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_reply); -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_status, tvb, offset, realsize - offset, ENC_ASCII | ENC_NA); -+ break; -+ } -+ case 'i': -+ case 'x': -+ case 'u': -+ case 'l': -+ case 'd': -+ case 'p': -+ case 'v': -+ case 'r': -+ case 'c': -+ case 'q': -+ rtpproxy_info = rtpproxy_add_tid(TRUE, tvb, pinfo, rtpproxy_tree, rtpproxy_conv, cookie); -+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request: %s", rawstr); -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_request, tvb, offset, -1, ENC_NA); -+ rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_request); -+ -+ /* A specific case - version request */ -+ if ((tmp == 'v') && (offset + (gint)strlen("VF YYYMMDD") + 1 == realsize)){ -+ /* Skip whitespace */ -+ new_offset = tvb_skip_wsp(tvb, offset + ((guint)strlen("VF") + 1), -1); -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_version_request, tvb, new_offset, (gint)strlen("YYYYMMDD"), ENC_ASCII | ENC_NA); -+ tmpstr = tvb_get_ephemeral_string(tvb, new_offset, (gint)strlen("YYYYMMDD")); -+ proto_item_append_text(ti, " (%s)", str_to_str(tmpstr, versiontypenames, "Unknown")); -+ break; -+ } -+ -+ /* All other commands */ -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_command, tvb, offset, 1, ENC_NA); -+ -+ /* A specific case - handshake/ping */ -+ if (tmp == 'v') -+ break; /* No more parameters */ -+ -+ /* A specific case - close all calls */ -+ if (tmp == 'x') -+ break; /* No more parameters */ -+ -+ /* Extract parameters */ -+ /* Parameters should be right after the command and before EOL (in case of Info command) or before whitespace */ -+ new_offset = (tmp == 'i' ? (realsize - 1 > offset ? offset + (gint)strlen("Ib") : offset + (gint)strlen("I")) : tvb_find_guint8(tvb, offset, -1, ' ')); -+ -+ if (new_offset != offset + 1){ -+ rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_command); -+ ti2 = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_command_parameters, tvb, offset+1, new_offset - (offset+1), ENC_ASCII | ENC_NA); -+ rtpproxy_add_parameter(proto_item_add_subtree(ti2, ett_rtpproxy_command_parameters), tvb, offset+1, new_offset - (offset+1)); -+ rtpproxy_tree = proto_item_get_parent(ti); -+ } -+ -+ /* A specific case - query information */ -+ if (tmp == 'i') -+ break; /* No more parameters */ -+ -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ /* Extract Call-ID */ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_callid, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); -+ if(rtpproxy_info && !rtpproxy_info->callid) -+ rtpproxy_info->callid = tvb_get_seasonal_string(tvb, offset, new_offset - offset); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ /* Extract IP and Port in case of Offer/Answer */ -+ if ((tmp == 'u') || (tmp == 'l')){ -+ /* Extract IP */ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ if (tvb_find_guint8(tvb, offset, new_offset - offset, ':') == -1) -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); -+ else -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ /* Extract Port */ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_port, tvb, offset, new_offset - offset, -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, offset, new_offset - offset), NULL, 10)); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ } -+ -+ /* Extract Copy target */ -+ if (tmp == 'c'){ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_copy_target, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ } -+ -+ /* Extract Playback file and codecs */ -+ if (tmp == 'p'){ -+ /* Extract filename */ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_playback_filename, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ /* Extract codec */ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_playback_codec, tvb, offset, new_offset - offset, -+ (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, offset, new_offset - offset), NULL, 10)); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ } -+ -+ /* Extract first tag */ -+ new_offset = rtpproxy_add_tag(rtpproxy_tree, tvb, offset, realsize); -+ if(new_offset == -1) -+ break; /* No more parameters */ -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ /* Extract second tag */ -+ new_offset = rtpproxy_add_tag(rtpproxy_tree, tvb, offset, realsize); -+ if(new_offset == -1) -+ break; /* No more parameters */ -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ /* Extract Notification address */ -+ if (tmp == 'u'){ -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify, tvb, offset, realsize - offset, ENC_ASCII | ENC_NA); -+ proto_item_set_text(ti, "Notify"); -+ rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_notify); -+ -+ /* Check for NotifyTag parameter (separated by space) */ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ if(new_offset == -1){ -+ /* NotifyTag wasn't found (we should re-use Call-ID instead) */ -+ rtpproxy_add_notify_addr(rtpproxy_tree, tvb, offset, realsize); -+ break; /* No more parameters */ -+ } -+ -+ /* NotifyTag was found */ -+ rtpproxy_add_notify_addr(rtpproxy_tree, tvb, offset, new_offset); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_tag, tvb, offset, realsize - offset, ENC_ASCII | ENC_NA); -+ } -+ break; -+ case 'a': -+ case 'e': -+ case '0': -+ case '1': -+ case '2': -+ case '3': -+ case '4': -+ case '5': -+ case '6': -+ case '7': -+ case '8': -+ case '9': -+ rtpproxy_info = rtpproxy_add_tid(FALSE, tvb, pinfo, rtpproxy_tree, rtpproxy_conv, cookie); -+ if (tmp == 'e') -+ col_add_fstr(pinfo->cinfo, COL_INFO, "Error reply: %s", rawstr); -+ else -+ col_add_fstr(pinfo->cinfo, COL_INFO, "Reply: %s", rawstr); -+ -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_reply, tvb, offset, -1, ENC_NA); -+ rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_reply); -+ -+ if(rtpproxy_info && rtpproxy_info->callid){ -+ ti = proto_tree_add_string(rtpproxy_tree, hf_rtpproxy_callid, tvb, offset, 0, rtpproxy_info->callid); -+ PROTO_ITEM_SET_GENERATED(ti); -+ } -+ -+ if (tmp == 'e'){ -+ tmp = tvb_find_line_end(tvb, offset, -1, &new_offset, FALSE); -+ tmpstr = tvb_get_ephemeral_string(tvb, offset, tmp); -+ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_error, tvb, offset, (gint)strlen(tmpstr), ENC_ASCII | ENC_NA); -+ proto_item_append_text(ti, " (%s)", str_to_str(tmpstr, errortypenames, "Unknown")); -+ break; -+ } -+ -+ if (tmp == 'a'){ -+ /* A specific case - short statistics answer */ -+ /* %COOKIE% active sessions: %NUM1% */ -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_status, tvb, offset, realsize - offset, ENC_ASCII | ENC_NA); -+ break; -+ } -+ if ((tmp == '0')&& ((tvb_reported_length(tvb) == (guint)(offset+1))||(tvb_reported_length(tvb) == (guint)(offset+2)))){ -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ok, tvb, offset, 1, ENC_ASCII | ENC_NA); -+ break; -+ } -+ if ((tmp == '1') && ((tvb_reported_length(tvb) == (guint)(offset+1))||(tvb_reported_length(tvb) == (guint)(offset+2)))){ -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ok, tvb, offset, 1, ENC_ASCII | ENC_NA); -+ break; -+ } -+ if (tvb_reported_length(tvb) == (guint)(offset+9)){ -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_version_supported, tvb, offset, 8, ENC_ASCII | ENC_NA); -+ break; -+ } -+ -+ /* Extract Port */ -+ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -+ /* Convert port to unsigned 16-bit number */ -+ port = (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, offset, new_offset - offset), NULL, 10); -+ proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_port, tvb, offset, new_offset - offset, port); -+ /* Skip whitespace */ -+ offset = tvb_skip_wsp(tvb, new_offset+1, -1); -+ -+ /* Extract IP */ -+ tmp = tvb_find_line_end(tvb, offset, -1, &new_offset, FALSE); -+ if (tvb_find_guint8(tvb, offset, -1, ':') == -1){ -+ inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, offset, tmp), ipaddr); -+ addr.type = AT_IPv4; -+ addr.len = 4; -+ addr.data = ep_memdup(ipaddr, 4); -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, tmp, ENC_ASCII | ENC_NA); -+ } -+ else{ -+ inet_pton(AF_INET6, (char*)tvb_get_ephemeral_string(tvb, offset, tmp), ipaddr); -+ addr.type = AT_IPv6; -+ addr.len = 16; -+ addr.data = ep_memdup(ipaddr, 16); -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, tmp, ENC_ASCII | ENC_NA); -+ } -+ -+ if(rtpproxy_establish_conversation){ -+ if (rtp_handle) { -+ /* FIXME tell if isn't a video stream, and setup codec mapping */ -+ rtp_add_address(pinfo, &addr, port, 0, "RTPproxy", pinfo->fd->num, 0, NULL); -+ } -+ if (rtcp_handle) { -+ rtcp_add_address(pinfo, &addr, port+1, 0, "RTPproxy", pinfo->fd->num); -+ } -+ } -+ break; -+ default: -+ break; -+ } -+ if (has_lf) -+ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_lf, tvb, realsize, 1, ENC_NA); -+ -+ return tvb_length(tvb); -+} -+ -+void -+proto_register_rtpproxy(void) -+{ -+ module_t *rtpproxy_module; -+ -+ static hf_register_info hf[] = { -+ { -+ &hf_rtpproxy_cookie, -+ { -+ "Cookie", -+ "rtpproxy.cookie", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_version_request, -+ { -+ "Version Request", -+ "rtpproxy.version", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_version_supported, -+ { -+ "Version Supported", -+ "rtpproxy.version_supported", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_error, -+ { -+ "Error", -+ "rtpproxy.error", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_ok, -+ { -+ "Ok", -+ "rtpproxy.ok", -+ FT_UINT8, -+ BASE_DEC, -+ VALS(oktypenames), -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_status, -+ { -+ "Status", -+ "rtpproxy.status", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_ipv4, -+ { -+ "IPv4", -+ "rtpproxy.ipv4", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_ipv6, -+ { -+ "IPv6", -+ "rtpproxy.ipv6", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_port, -+ { -+ "Port", -+ "rtpproxy.port", -+ FT_UINT16, /* 0 - 65535 */ -+ BASE_DEC, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_request, -+ { -+ "Request", -+ "rtpproxy.request", -+ FT_NONE, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command, -+ { -+ "Command", -+ "rtpproxy.command", -+ FT_UINT8, -+ BASE_DEC, -+ VALS(commandtypenames), -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameters, -+ { -+ "Command parameters", -+ "rtpproxy.command_parameters", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter, -+ { -+ "Parameter", -+ "rtpproxy.command_parameter", -+ FT_UINT8, -+ BASE_DEC, -+ VALS(paramtypenames), -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_codec, -+ { -+ "Allowed codec", -+ "rtpproxy.command_parameter_codec", -+ FT_UINT8, /* 0 - 127 */ -+ BASE_DEC, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_local, -+ { -+ "Local IP address", -+ "rtpproxy.command_parameter_local", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_remote, -+ { -+ "Remote IP address", -+ "rtpproxy.command_parameter_remote", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_repacketize, -+ { -+ "Repacketize (ms)", -+ "rtpproxy.command_parameter_repacketize", -+ FT_UINT16, /* 0 - 1000 milliseconds */ -+ BASE_DEC, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_dtmf, -+ { -+ "DTMF payload ID", -+ "rtpproxy.command_parameter_dtmf", -+ FT_UINT8, /* 0 - 127 */ -+ BASE_DEC, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_proto, -+ { -+ "RTP tramsission protocol", -+ "rtpproxy.command_parameter_proto", -+ FT_UINT8, -+ BASE_DEC, -+ VALS(prototypenames), -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_transcode, -+ { -+ "Transcode to", -+ "rtpproxy.command_parameter_transcode", -+ FT_UINT8, /* 0 - 127 */ -+ BASE_DEC, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_command_parameter_acc, -+ { -+ "Accounting", -+ "rtpproxy.command_parameter_acc", -+ FT_UINT8, -+ BASE_DEC, -+ VALS(acctypenames), -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_copy_target, -+ { -+ "Copy target", -+ "rtpproxy.copy_target", -+ FT_STRING, /* Filename or UDP address, e.g. /var/tmp/fileXXXX.yyy or IP:Port */ -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_playback_filename, -+ { -+ "Playback filename", -+ "rtpproxy.playback_filename", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_playback_codec, -+ { -+ "Playback codec", -+ "rtpproxy.playback_codec", -+ FT_UINT8, /* 0 - 127 */ -+ BASE_DEC, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_callid, -+ { -+ "Call-ID", -+ "rtpproxy.callid", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_notify, -+ { -+ "Notify", -+ "rtpproxy.notify", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_tag, -+ { -+ "Tag", -+ "rtpproxy.tag", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_mediaid, -+ { -+ "Media-ID", -+ "rtpproxy.mediaid", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_notify_ipv4, -+ { -+ "Notification IPv4", -+ "rtpproxy.notify_ipv4", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_notify_ipv6, -+ { -+ "Notification IPv6", -+ "rtpproxy.notify_ipv6", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_notify_port, -+ { -+ "Notification Port", -+ "rtpproxy.notify_port", -+ FT_UINT16, -+ BASE_DEC, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_notify_tag, -+ { -+ "Notification Tag", -+ "rtpproxy.notify_tag", -+ FT_STRING, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_reply, -+ { -+ "Reply", -+ "rtpproxy.reply", -+ FT_NONE, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_lf, -+ { -+ "LF", -+ "rtpproxy.lf", -+ FT_NONE, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_request_in, -+ { -+ "Request In", -+ "rtpproxy.request_in", -+ FT_FRAMENUM, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ -+ }, -+ { -+ &hf_rtpproxy_response_in, -+ { -+ "Response In", -+ "rtpproxy.response_in", -+ FT_FRAMENUM, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ NULL, -+ HFILL -+ } -+ }, -+ { -+ &hf_rtpproxy_response_time, -+ { -+ "Response Time", -+ "rtpproxy.response_time", -+ FT_RELATIVE_TIME, -+ BASE_NONE, -+ NULL, -+ 0x0, -+ "The time between the Request and the Reply", -+ HFILL -+ } -+ } -+ }; -+ -+ /* Setup protocol subtree array */ -+ static gint *ett[] = { -+ &ett_rtpproxy, -+ &ett_rtpproxy_request, -+ &ett_rtpproxy_command, -+ &ett_rtpproxy_command_parameters, -+ &ett_rtpproxy_command_parameters_codecs, -+ &ett_rtpproxy_command_parameters_local, -+ &ett_rtpproxy_command_parameters_remote, -+ &ett_rtpproxy_command_parameters_repacketize, -+ &ett_rtpproxy_command_parameters_dtmf, -+ &ett_rtpproxy_command_parameters_cmap, -+ &ett_rtpproxy_command_parameters_proto, -+ &ett_rtpproxy_command_parameters_transcode, -+ &ett_rtpproxy_command_parameters_acc, -+ &ett_rtpproxy_tag, -+ &ett_rtpproxy_notify, -+ &ett_rtpproxy_reply -+ }; -+ -+ proto_rtpproxy = proto_register_protocol ( -+ "Sippy RTPproxy Protocol", /* name */ -+ "RTPproxy", /* short name */ -+ "rtpproxy" /* abbrev */ -+ ); -+ -+ proto_register_field_array(proto_rtpproxy, hf, array_length(hf)); -+ proto_register_subtree_array(ett, array_length(ett)); -+ -+ rtpproxy_module = prefs_register_protocol(proto_rtpproxy, proto_reg_handoff_rtpproxy); -+ -+ prefs_register_uint_preference(rtpproxy_module, "tcp.port", -+ "RTPproxy TCP Port", /* Title */ -+ "RTPproxy TCP Port", /* Descr */ -+ 10, -+ &rtpproxy_tcp_port); -+ -+ prefs_register_uint_preference(rtpproxy_module, "udp.port", -+ "RTPproxy UDP Port", /* Title */ -+ "RTPproxy UDP Port", /* Descr */ -+ 10, -+ &rtpproxy_udp_port); -+ -+ prefs_register_bool_preference(rtpproxy_module, "establish_conversation", -+ "Establish Media Conversation", -+ "Specifies that RTP/RTCP/T.38/MSRP/etc streams are decoded based " -+ "upon port numbers found in RTPproxy answers", -+ &rtpproxy_establish_conversation); -+ -+ prefs_register_uint_preference(rtpproxy_module, "reply.timeout", -+ "RTPproxy reply timeout", /* Title */ -+ "Maximum timeout value in waiting for reply from RTPProxy (in milliseconds).", /* Descr */ -+ 10, -+ &rtpproxy_timeout); -+} -+ -+void -+proto_reg_handoff_rtpproxy(void) -+{ -+ static guint old_rtpproxy_tcp_port = 0; -+ static guint old_rtpproxy_udp_port = 0; -+ -+ static gboolean rtpproxy_initialized = FALSE; -+ -+ static dissector_handle_t rtpproxy_tcp_handle, rtpproxy_udp_handle; -+ -+ if(!rtpproxy_initialized){ -+ rtpproxy_tcp_handle = new_create_dissector_handle(dissect_rtpproxy, proto_rtpproxy); -+ rtpproxy_udp_handle = new_create_dissector_handle(dissect_rtpproxy, proto_rtpproxy); -+ rtpproxy_initialized = TRUE; -+ } -+ -+ /* Register TCP port for dissection */ -+ if(old_rtpproxy_tcp_port != 0 && old_rtpproxy_tcp_port != rtpproxy_tcp_port) -+ dissector_delete_uint("tcp.port", old_rtpproxy_tcp_port, rtpproxy_tcp_handle); -+ if(rtpproxy_tcp_port != 0 && old_rtpproxy_tcp_port != rtpproxy_tcp_port) -+ dissector_add_uint("tcp.port", rtpproxy_tcp_port, rtpproxy_tcp_handle); -+ old_rtpproxy_tcp_port = rtpproxy_tcp_port; -+ -+ /* Register UDP port for dissection */ -+ if(old_rtpproxy_udp_port != 0 && old_rtpproxy_udp_port != rtpproxy_udp_port) -+ dissector_delete_uint("udp.port", old_rtpproxy_udp_port, rtpproxy_udp_handle); -+ if(rtpproxy_udp_port != 0 && old_rtpproxy_udp_port != rtpproxy_udp_port) -+ dissector_add_uint("udp.port", rtpproxy_udp_port, rtpproxy_udp_handle); -+ old_rtpproxy_udp_port = rtpproxy_udp_port; -+ -+ rtcp_handle = find_dissector("rtcp"); -+ rtp_events_handle = find_dissector("rtpevent"); -+ rtp_handle = find_dissector("rtp"); -+ -+ /* Calculate nstime_t struct for the timeout from the rtpproxy_timeout value in milliseconds */ -+ rtpproxy_timeout_ns.secs = (rtpproxy_timeout - rtpproxy_timeout % 1000) / 1000; -+ rtpproxy_timeout_ns.nsecs = (rtpproxy_timeout % 1000) * 1000; -+} -+ -+/* -+ * 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 --git a/wireshark-0007-Install-autoconf-related-file.patch b/wireshark-0007-Install-autoconf-related-file.patch new file mode 100644 index 0000000..ac98fdd --- /dev/null +++ b/wireshark-0007-Install-autoconf-related-file.patch @@ -0,0 +1,233 @@ +From: Peter Lemenkov +Date: Fri, 13 Sep 2013 15:25:12 +0400 +Subject: [PATCH] Install autoconf-related file + + +diff --git a/Makefile.am b/Makefile.am +index 40a6e4d..82f7fdf 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -56,6 +56,9 @@ EXTRA_PROGRAMS = wireshark wireshark-qt tshark tfshark capinfos captype editcap + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = wireshark.pc + ++autoconfigdir = $(datadir)/aclocal ++autoconfig_DATA = wireshark.m4 ++ + # + # Wireshark configuration files are put in $(pkgdatadir). + # +diff --git a/wireshark-autoconf.m4 b/wireshark-autoconf.m4 +deleted file mode 100644 +index d8015d8..0000000 +--- a/wireshark-autoconf.m4 ++++ /dev/null +@@ -1,101 +0,0 @@ +-dnl AM_PATH_WIRESHARK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +-dnl Test for wireshark development files, and define WIRESHARK_CFLAGS, +-dnl WIRESHARK_LIBS and WIRESHARK_VERSION. +-dnl +-AC_DEFUN([AM_PATH_WIRESHARK],[ +- AC_ARG_WITH(wireshark-prefix, +- [ --with-wireshark-prefix=PFX Prefix where wireshark libraries are installed (optional)], +- wireshark_config_prefix="$withval", wireshark_config_prefix="") +- +- wireshark_found=no +- if test "$wireshark_config_prefix" != "" ; then +- AM_PATH_GLIB_2_0(,,,[gmodule]) +- WIRESHARK_CFLAGS="-DWS_VAR_IMPORT=extern -DWS_MSVC_NORETURN= -I$wireshark_config_prefix/include/wireshark -I$wireshark_config_prefix/include/wireshark/epan -I/usr/include/wireshark -I/usr/include/wireshark/epan $GLIB_CFLAGS" +- WIRESHARK_LIBS="-L$wireshark_config_prefix/lib -lwireshark -lwiretap $GLIB_LIBS" +- wireshark_found=yes +- else +- PKG_PROG_PKG_CONFIG() +- PKG_CHECK_MODULES(WIRESHARK, wireshark, wireshark_found=yes) +- fi +- +- ac_save_CFLAGS="$CFLAGS" +- ac_save_CLIBS="$LIBS" +- CFLAGS="$CFLAGS $WIRESHARK_CFLAGS" +- LIBS="$WIRESHARK_LIBS $LIBS" +- min_wireshark_version=ifelse([$1], ,0.0.0,[$1]) +- if test $wireshark_found = yes; then +- AC_MSG_CHECKING(for wireshark version >= $min_wireshark_version) +- wireshark_found=no +- AC_TRY_RUN([ +-#include +-#include +-#include +-#include +-#include +-#include +- +-int +-main() +- +-{ +- int ws_major_version, ws_minor_version, ws_micro_version; +- int major, minor, micro; +- char **tmp_version; +- +- tmp_version = (char *) strdup("$min_wireshark_version"); +- major = 0; +- minor = 0; +- micro = 0; +- sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ); +- free(tmp_version); +- tmp_version = (char *) epan_get_version(); +- sscanf(tmp_version, "%d.%d.%d", +- &ws_major_version, &ws_minor_version, &ws_micro_version); +- +- if (ws_major_version > major || +- (ws_major_version == major && ws_minor_version > minor) || +- (ws_major_version == major && ws_minor_version == minor && +- ws_micro_version >= micro)) +- return 0; +- +- printf("\n*** An old version of wireshark (%d.%d.%d) was found.\n", +- ws_major_version, ws_minor_version, ws_micro_version); +- printf("*** You need a version of wireshark not older than %d.%d.%d. ", +- major, minor, micro); +- return 1; +-} +- ], wireshark_found=yes) +- fi +- +- if test "$wireshark_found" != no; then +- AC_LANG_PUSH(C) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([ +-#include +-#include +-#include +-#include +-#include +-#include +-], [puts(epan_get_version());])], [WIRESHARK_VERSION=`./conftest$ac_exeext`], +-wireshark_found=no) +- +- AC_LANG_POP +- fi +- +- CFLAGS="$ac_save_CFLAGS" +- LIBS="$ac_save_LIBS" +- +- if test "$wireshark_found" != no; then +- AC_MSG_RESULT(yes) +- ifelse([$2],, :, [$2]) +- else +- AC_MSG_RESULT(no) +- WIRESHARK_CFLAGS="" +- WIRESHARK_LIBS="" +- WIRESHARK_VERSION="" +- ifelse([$3], , :, [$3]) +- fi +- AC_SUBST(WIRESHARK_CFLAGS) +- AC_SUBST(WIRESHARK_LIBS) +- AC_SUBST(WIRESHARK_VERSION) +-]) +diff --git a/wireshark.m4 b/wireshark.m4 +new file mode 100644 +index 0000000..d8015d8 +--- /dev/null ++++ b/wireshark.m4 +@@ -0,0 +1,101 @@ ++dnl AM_PATH_WIRESHARK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) ++dnl Test for wireshark development files, and define WIRESHARK_CFLAGS, ++dnl WIRESHARK_LIBS and WIRESHARK_VERSION. ++dnl ++AC_DEFUN([AM_PATH_WIRESHARK],[ ++ AC_ARG_WITH(wireshark-prefix, ++ [ --with-wireshark-prefix=PFX Prefix where wireshark libraries are installed (optional)], ++ wireshark_config_prefix="$withval", wireshark_config_prefix="") ++ ++ wireshark_found=no ++ if test "$wireshark_config_prefix" != "" ; then ++ AM_PATH_GLIB_2_0(,,,[gmodule]) ++ WIRESHARK_CFLAGS="-DWS_VAR_IMPORT=extern -DWS_MSVC_NORETURN= -I$wireshark_config_prefix/include/wireshark -I$wireshark_config_prefix/include/wireshark/epan -I/usr/include/wireshark -I/usr/include/wireshark/epan $GLIB_CFLAGS" ++ WIRESHARK_LIBS="-L$wireshark_config_prefix/lib -lwireshark -lwiretap $GLIB_LIBS" ++ wireshark_found=yes ++ else ++ PKG_PROG_PKG_CONFIG() ++ PKG_CHECK_MODULES(WIRESHARK, wireshark, wireshark_found=yes) ++ fi ++ ++ ac_save_CFLAGS="$CFLAGS" ++ ac_save_CLIBS="$LIBS" ++ CFLAGS="$CFLAGS $WIRESHARK_CFLAGS" ++ LIBS="$WIRESHARK_LIBS $LIBS" ++ min_wireshark_version=ifelse([$1], ,0.0.0,[$1]) ++ if test $wireshark_found = yes; then ++ AC_MSG_CHECKING(for wireshark version >= $min_wireshark_version) ++ wireshark_found=no ++ AC_TRY_RUN([ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int ++main() ++ ++{ ++ int ws_major_version, ws_minor_version, ws_micro_version; ++ int major, minor, micro; ++ char **tmp_version; ++ ++ tmp_version = (char *) strdup("$min_wireshark_version"); ++ major = 0; ++ minor = 0; ++ micro = 0; ++ sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ); ++ free(tmp_version); ++ tmp_version = (char *) epan_get_version(); ++ sscanf(tmp_version, "%d.%d.%d", ++ &ws_major_version, &ws_minor_version, &ws_micro_version); ++ ++ if (ws_major_version > major || ++ (ws_major_version == major && ws_minor_version > minor) || ++ (ws_major_version == major && ws_minor_version == minor && ++ ws_micro_version >= micro)) ++ return 0; ++ ++ printf("\n*** An old version of wireshark (%d.%d.%d) was found.\n", ++ ws_major_version, ws_minor_version, ws_micro_version); ++ printf("*** You need a version of wireshark not older than %d.%d.%d. ", ++ major, minor, micro); ++ return 1; ++} ++ ], wireshark_found=yes) ++ fi ++ ++ if test "$wireshark_found" != no; then ++ AC_LANG_PUSH(C) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([ ++#include ++#include ++#include ++#include ++#include ++#include ++], [puts(epan_get_version());])], [WIRESHARK_VERSION=`./conftest$ac_exeext`], ++wireshark_found=no) ++ ++ AC_LANG_POP ++ fi ++ ++ CFLAGS="$ac_save_CFLAGS" ++ LIBS="$ac_save_LIBS" ++ ++ if test "$wireshark_found" != no; then ++ AC_MSG_RESULT(yes) ++ ifelse([$2],, :, [$2]) ++ else ++ AC_MSG_RESULT(no) ++ WIRESHARK_CFLAGS="" ++ WIRESHARK_LIBS="" ++ WIRESHARK_VERSION="" ++ ifelse([$3], , :, [$3]) ++ fi ++ AC_SUBST(WIRESHARK_CFLAGS) ++ AC_SUBST(WIRESHARK_LIBS) ++ AC_SUBST(WIRESHARK_VERSION) ++]) diff --git a/wireshark-0007-The-beginning-of-an-openflow-dissector.patch b/wireshark-0007-The-beginning-of-an-openflow-dissector.patch deleted file mode 100644 index b4be51d..0000000 --- a/wireshark-0007-The-beginning-of-an-openflow-dissector.patch +++ /dev/null @@ -1,1513 +0,0 @@ -From: Anders Broman -Date: Thu, 11 Jul 2013 21:13:27 +0000 -Subject: [PATCH] The beginning of an openflow dissector. - -svn path=/trunk/; revision=50513 - -Fix cut-and-pasteo found by a compiler warning. - -Mark an unused parameter as unused. - -svn path=/trunk/; revision=50515 - -Update dissection. - -svn path=/trunk/; revision=50604 - -Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang - -svn path=/trunk/; revision=50621 - -Fix warnings found by fix-encoding-args tools.(and remove some tabs also) - -svn path=/trunk/; revision=50623 - -dissect OFPT_PACKET_IN. - -svn path=/trunk/; revision=51633 - -Dissect more of openflow. - -svn path=/trunk/; revision=51649 - -Fix -packet-openflow.c:318: warning: return type defaults to 'int' -packet-openflow.c: In function 'dissect_openflow_ofp_match_v_1_0': -packet-openflow.c:350: warning: control reaches end of non-void function - -svn path=/trunk/; revision=51650 - -Fix compilation with Linux packet-openflow.c: In function 'dissect_openflow_pkt_out': packet-openflow.c:663:13: error: variable 'actions_len' set but not used [-Werror=unused-but-set-variable] - -And make fix-encoding-args happy - -svn path=/trunk/; revision=51651 - -Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang - -svn path=/trunk/; revision=51737 - -Fix "malformed packet" and tidy up a bit. - -svn path=/trunk/; revision=51740 - -diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt -index 9c547b3..22fd862 100644 ---- a/epan/CMakeLists.txt -+++ b/epan/CMakeLists.txt -@@ -972,6 +972,7 @@ set(DISSECTOR_SRC - dissectors/packet-olsr.c - dissectors/packet-omapi.c - dissectors/packet-omron-fins.c -+ dissectors/packet-openflow.c - dissectors/packet-opensafety.c - dissectors/packet-openvpn.c - dissectors/packet-openwire.c -diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common -index 73217d7..3986ffd 100644 ---- a/epan/dissectors/Makefile.common -+++ b/epan/dissectors/Makefile.common -@@ -893,6 +893,7 @@ DISSECTOR_SRC = \ - packet-olsr.c \ - packet-omapi.c \ - packet-omron-fins.c \ -+ packet-openflow.c \ - packet-opensafety.c \ - packet-openvpn.c \ - packet-openwire.c \ -diff --git a/epan/dissectors/packet-openflow.c b/epan/dissectors/packet-openflow.c -new file mode 100644 -index 0000000..cc71824 ---- /dev/null -+++ b/epan/dissectors/packet-openflow.c -@@ -0,0 +1,1430 @@ -+/* packet-openflow.c -+ * Routines for OpenFlow dissection -+ * Copyright 2013, Anders Broman -+ * -+ * $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. -+ * -+ * Ref https://www.opennetworking.org/sdn-resources/onf-specifications/openflow -+ */ -+ -+#include "config.h" -+ -+#include -+ -+#include -+#include -+ -+void proto_reg_handoff_openflow(void); -+ -+static int g_openflow_port = 0; -+ -+dissector_handle_t eth_withoutfcs_handle; -+ -+/* Initialize the protocol and registered fields */ -+static int proto_openflow = -1; -+static int hf_openflow_version = -1; -+static int hf_openflow_type = -1; -+static int hf_openflow_length = -1; -+static int hf_openflow_xid = -1; -+ -+static int hf_openflow_datapath_id = -1; -+static int hf_openflow_datapath_mac = -1; -+static int hf_openflow_datapath_impl = -1; -+static int hf_openflow_n_buffers = -1; -+static int hf_openflow_n_tables = -1; -+static int hf_openflow_pad3 = -1; -+static int hf_openflow_capabilities = -1; -+static int hf_openflow_actions = -1; -+static int hf_openflow_reserved32 = -1; -+static int hf_openflow_cap_flow_stats = -1; -+static int hf_openflow_table_stats = -1; -+static int hf_openflow_port_stats = -1; -+static int hf_openflow_group_stats = -1; -+static int hf_openflow_ip_reasm = -1; -+static int hf_openflow_queue_stats = -1; -+static int hf_openflow_port_blocked = -1; -+ -+static int hf_openflow_output = -1; /* Output to switch port. */ -+static int hf_openflow_set_vlan_vid = -1; /* Set the 802.1q VLAN id. */ -+static int hf_openflow_set_vlan_pcp = -1; /* Set the 802.1q priority. */ -+static int hf_openflow_strip_vlan = -1; /* Strip the 802.1q header. */ -+static int hf_openflow_set_dl_src = -1; /* Ethernet source address. */ -+static int hf_openflow_set_dl_dst = -1; /* Ethernet destination address. */ -+static int hf_openflow_set_nw_src = -1; /* IP source address. */ -+static int hf_openflow_set_nw_dst = -1; /* IP destination address. */ -+static int hf_openflow_set_nw_tos = -1; /* IP ToS (DSCP field, 6 bits). */ -+static int hf_openflow_set_tp_src = -1; /* TCP/UDP source port. */ -+static int hf_openflow_set_tp_dst = -1; /* TCP/UDP destination port. */ -+static int hf_openflow_enqueue = -1; /* Output to queue. */ -+ -+static int hf_openflow_port_no = -1; -+static int hf_openflow_hw_addr = -1; -+static int hf_openflow_port_name = -1; -+ -+ -+static int hf_openflow_port_config = -1; -+static int hf_openflow_port_state = -1; -+static int hf_openflow_port_curr = -1; -+static int hf_openflow_port_advertised = -1; -+static int hf_openflow_port_supported = -1; -+static int hf_openflow_port_peer = -1; -+ -+static int hf_openflow_port_down = -1; /* Port is administratively down. */ -+static int hf_openflow_no_stp = -1; /* Disable 802.1D spanning tree on port. */ -+static int hf_openflow_no_recv = -1; /* Drop all packets except 802.1D spanning tree packets. */ -+static int hf_openflow_no_recv_stp = -1; /* Drop received 802.1D STP packets. */ -+static int hf_openflow_no_flood = -1; /* Do not include this port when flooding. */ -+static int hf_openflow_no_fwd = -1; /* Drop packets forwarded to port. */ -+static int hf_openflow_no_packet_in = -1; /* Do not send packet-in msgs for port. */ -+ -+static int hf_openflow_link_down = -1; /* No physical link present. */ -+ -+static int hf_openflow_10mb_hd = -1; /* 10 Mb half-duplex rate support. */ -+static int hf_openflow_10mb_fd = -1; /* 10 Mb full-duplex rate support. */ -+static int hf_openflow_100mb_hd = -1; /* 100 Mb half-duplex rate support. */ -+static int hf_openflow_100mb_fd = -1; /* 100 Mb full-duplex rate support. */ -+static int hf_openflow_1gb_hd = -1; /* 1 Gb half-duplex rate support. */ -+static int hf_openflow_1gb_fd = -1; /* 1 Gb full-duplex rate support. */ -+static int hf_openflow_10gb_fd = -1; /* 10 Gb full-duplex rate support. */ -+static int hf_openflow_copper = -1; /* Copper medium. */ -+static int hf_openflow_fiber = -1; /* Fiber medium. */ -+static int hf_openflow_autoneg = -1; /* Auto-negotiation. */ -+static int hf_openflow_pause = -1; /* Pause. */ -+static int hf_openflow_pause_asym = -1; /* Asymmetric pause. */ -+ -+static int hf_openflow_config_flags = -1; -+static int hf_openflow_miss_send_len = -1; -+ -+static int hf_openflow_buffer_id = -1; -+static int hf_openflow_total_len = -1; -+static int hf_openflow_in_port = -1; -+static int hf_openflow_reason = -1; -+static int hf_openflow_table_id = -1; -+static int hf_openflow_cookie = -1; -+static int hf_openflow_cookie_mask = -1; -+static int hf_openflow_padd8 = -1; -+static int hf_openflow_padd16 = -1; -+static int hf_openflow_padd48 = -1; -+static int hf_openflow_actions_len = -1; -+static int hf_openflow_action_type = -1; -+static int hf_openflow_action_len = -1; -+static int hf_openflow_output_port = -1; -+static int hf_openflow_max_len = -1; -+static int hf_openflow_wildcards = -1; -+static int hf_openflow_command = -1; -+static int hf_openflow_eth_src = -1; -+static int hf_openflow_eth_dst = -1; -+static int hf_openflow_dl_vlan = -1; -+static int hf_openflow_dl_vlan_pcp = -1; -+static int hf_openflow_idle_timeout = -1; -+static int hf_openflow_hard_timeout = -1; -+static int hf_openflow_priority = -1; -+static int hf_openflow_out_port = -1; -+static int hf_openflow_out_group = -1; -+static int hf_openflow_flags = -1; -+ -+/* Initialize the subtree pointers */ -+static gint ett_openflow = -1; -+static gint ett_openflow_path_id = -1; -+static gint ett_openflow_cap = -1; -+static gint ett_openflow_act = -1; -+static gint ett_openflow_port = -1; -+static gint ett_openflow_port_cnf = -1; -+static gint ett_openflow_port_state = -1; -+static gint ett_port_cf = -1; -+ -+#define OFP_VERSION_1_0 1 -+#define OFP_VERSION_1_1 2 -+#define OFP_VERSION_1_2 3 -+#define OFP_VERSION_1_3 4 -+ -+static const value_string openflow_version_values[] = { -+ { 0x01, "1.0" }, -+ { 0x02, "1.1" }, -+ { 0x03, "1.2" }, -+ { 0x04, "1.3" }, -+ { 0, NULL } -+}; -+ -+/* Immutable messages. */ -+#define OFPT_HELLO 0 /* Symmetric message */ -+#define OFPT_ERROR 1 /* Symmetric message */ -+#define OFPT_ECHO_REQUEST 2 /* Symmetric message */ -+#define OFPT_ECHO_REPLY 3 /* Symmetric message */ -+#define OFPT_EXPERIMENTER 4 /* Symmetric message */ -+/* Switch configuration messages. */ -+#define OFPT_FEATURES_REQUEST 5 /* Controller/switch message */ -+#define OFPT_FEATURES_REPLY 6 /* Controller/switch message */ -+#define OFPT_GET_CONFIG_REQUEST 7 /* Controller/switch message */ -+#define OFPT_GET_CONFIG_REPLY 8 /* Controller/switch message */ -+#define OFPT_SET_CONFIG 9 /* Controller/switch message */ -+/* Asynchronous messages. */ -+#define OFPT_PACKET_IN 10 /* Async message */ -+#define OFPT_FLOW_REMOVED 11 /* Async message */ -+#define OFPT_PORT_STATUS 12 /* Async message */ -+/* Controller command messages. */ -+#define OFPT_PACKET_OUT 13 /* Controller/switch message */ -+#define OFPT_FLOW_MOD 14 /* Controller/switch message */ -+#define OFPT_GROUP_MOD 15 /* Controller/switch message */ -+#define OFPT_PORT_MOD 16 /* Controller/switch message */ -+#define OFPT_TABLE_MOD 17 /* Controller/switch message */ -+/* Multipart messages. */ -+#define OFPT_MULTIPART_REQUEST 18 /* Controller/switch message */ -+#define OFPT_MULTIPART_REPLY 19 /* Controller/switch message */ -+/* Barrier messages. */ -+#define OFPT_BARRIER_REQUEST 20 /* Controller/switch message */ -+#define OFPT_BARRIER_REPLY 21 /* Controller/switch message */ -+/* Queue Configuration messages. */ -+#define OFPT_QUEUE_GET_CONFIG_REQUEST 22 /* Controller/switch message */ -+#define OFPT_QUEUE_GET_CONFIG_REPLY 23 /* Controller/switch message */ -+/* Controller role change request messages. */ -+#define OFPT_ROLE_REQUEST 24 /* Controller/switch message */ -+#define OFPT_ROLE_REPLY 25 /* Controller/switch message */ -+/* Asynchronous message configuration. */ -+#define OFPT_GET_ASYNC_REQUEST 26 /* Controller/switch message */ -+#define OFPT_GET_ASYNC_REPLY 27 /* Controller/switch message */ -+#define OFPT_SET_ASYNC 28 /* Controller/switch message */ -+/* Meters and rate limiters configuration messages. */ -+#define OFPT_METER_MOD 29 /* Controller/switch message */ -+ -+static const value_string openflow_type_values[] = { -+/* Immutable messages. */ -+ { 0, "OFPT_HELLO" }, /* Symmetric message */ -+ { 1, "OFPT_ERROR" }, /* Symmetric message */ -+ { 2, "OFPT_ECHO_REQUEST" }, /* Symmetric message */ -+ { 3, "OFPT_ECHO_REPLY" }, /* Symmetric message */ -+ { 4, "OFPT_EXPERIMENTER" }, /* Symmetric message */ -+/* Switch configuration messages. */ -+ { 5, "OFPT_FEATURES_REQUEST" }, /* Controller/switch message */ -+ { 6, "OFPT_FEATURES_REPLY" }, /* Controller/switch message */ -+ { 7, "OFPT_GET_CONFIG_REQUEST" }, /* Controller/switch message */ -+ { 8, "OFPT_GET_CONFIG_REPLY" }, /* Controller/switch message */ -+ { 9, "OFPT_SET_CONFIG" }, /* Controller/switch message */ -+/* Asynchronous messages. */ -+ { 10, "OFPT_PACKET_IN" }, /* Async message */ -+ { 11, "OFPT_FLOW_REMOVED" }, /* Async message */ -+ { 12, "OFPT_PORT_STATUS" }, /* Async message */ -+/* Controller command messages. */ -+ { 13, "OFPT_PACKET_OUT" }, /* Controller/switch message */ -+ { 14, "OFPT_FLOW_MOD" }, /* Controller/switch message */ -+ { 15, "OFPT_GROUP_MOD" }, /* Controller/switch message */ -+ { 16, "OFPT_PORT_MOD" }, /* Controller/switch message */ -+ { 17, "OFPT_TABLE_MOD" }, /* Controller/switch message */ -+/* Multipart messages. */ -+ { 18, "OFPT_MULTIPART_REQUEST" }, /* Controller/switch message */ -+ { 19, "OFPT_MULTIPART_REPLY" }, /* Controller/switch message */ -+/* Barrier messages. */ -+ { 20, "OFPT_BARRIER_REQUEST" }, /* Controller/switch message */ -+ { 21, "OFPT_BARRIER_REPLY" }, /* Controller/switch message */ -+/* Queue Configuration messages. */ -+ { 22, "OFPT_QUEUE_GET_CONFIG_REQUEST" }, /* Controller/switch message */ -+ { 23, "OFPT_QUEUE_GET_CONFIG_REPLY" }, /* Controller/switch message */ -+/* Controller role change request messages. */ -+ { 24, "OFPT_ROLE_REQUEST" }, /* Controller/switch message */ -+ { 25, "OFPT_ROLE_REPLY" }, /* Controller/switch message */ -+/* Asynchronous message configuration. */ -+ { 26, "OFPT_GET_ASYNC_REQUEST" }, /* Controller/switch message */ -+ { 27, "OFPT_GET_ASYNC_REPLY" }, /* Controller/switch message */ -+ { 28, "OFPT_SET_ASYNC" }, /* Controller/switch message */ -+/* Meters and rate limiters configuration messages. */ -+ { 29, "OFPT_METER_MOD" }, /* Controller/switch message */ -+ { 0, NULL } -+}; -+ -+#define OFPC_FLOW_STATS 1<<0 /* Flow statistics. */ -+#define OFPC_TABLE_STATS 1<<1 /* Table statistics. */ -+#define OFPC_PORT_STATS 1<<2 /* Port statistics. */ -+#define OFPC_GROUP_STATS 1<<3 /* Group statistics. */ -+#define OFPC_IP_REASM 1<<5 /* Can reassemble IP fragments. */ -+#define OFPC_QUEUE_STATS 1<<6 /* Queue statistics. */ -+#define OFPC_PORT_BLOCKED 1<<8 /* Switch will block looping ports. */ -+ -+#define OFPAT_OUTPUT_MASK 1<<0 /* Output to switch port. */ -+#define OFPAT_SET_VLAN_VID_MASK 1<<1 /* Set the 802.1q VLAN id. */ -+#define OFPAT_SET_VLAN_PCP_MASK 1<<2 /* Set the 802.1q priority. */ -+#define OFPAT_STRIP_VLAN_MASK 1<<3 /* Strip the 802.1q header. */ -+#define OFPAT_SET_DL_SRC_MASK 1<<4 /* Ethernet source address. */ -+#define OFPAT_SET_DL_DST_MASK 1<<5 /* Ethernet destination address. */ -+#define OFPAT_SET_NW_SRC_MASK 1<<6 /* IP source address. */ -+#define OFPAT_SET_NW_DST_MASK 1<<7 /* IP destination address. */ -+#define OFPAT_SET_NW_TOS_MASK 1<<8 /* IP ToS (DSCP field, 6 bits). */ -+#define OFPAT_SET_TP_SRC_MASK 1<<9 /* TCP/UDP source port. */ -+#define OFPAT_SET_TP_DST_MASK 1<<10 /* TCP/UDP destination port. */ -+#define OFPAT_ENQUEUE_MASK 1<<11 /* Output to queue. */ -+ -+#define OFPPC_PORT_DOWN 1<<0 /* Port is administratively down. */ -+#define OFPPC_NO_STP 1<<1 /* Disable 802.1D spanning tree on port. */ -+#define OFPPC_NO_RECV 1<<2 /* Drop all packets except 802.1D spanning tree packets. */ -+#define OFPPC_NO_RECV_STP 1<<3 /* Drop received 802.1D STP packets. */ -+#define OFPPC_NO_FLOOD 1<<4 /* Do not include this port when flooding. */ -+#define OFPPC_NO_FWD 1<<5 /* Drop packets forwarded to port. */ -+#define OFPPC_NO_PACKET_IN 1<<6 /* Do not send packet-in msgs for port. */ -+ -+#define OFP_MAX_PORT_NAME_LEN 16 -+ -+#define OFPPS_LINK_DOWN 1<<0 /* No physical link present. */ -+#define OFPPS_STP_LISTEN 0<<8 /* Not learning or relaying frames. */ -+#define OFPPS_STP_LEARN 1<<8 /* Learning but not relaying frames. */ -+#define OFPPS_STP_FORWARD 2<<8 /* Learning and relaying frames. */ -+#define OFPPS_STP_BLOCK 3<<8 /* Not part of spanning tree. */ -+#define OFPPS_STP_MASK 3<<8 /* Bit mask for OFPPS_STP_* values. */ -+ -+ -+#define OFPPF_10MB_HD 1<<0 /* 10 Mb half-duplex rate support. */ -+#define OFPPF_10MB_FD 1<<1 /* 10 Mb full-duplex rate support. */ -+#define OFPPF_100MB_HD 1<<2 /* 100 Mb half-duplex rate support. */ -+#define OFPPF_100MB_FD 1<<3 /* 100 Mb full-duplex rate support. */ -+#define OFPPF_1GB_HD 1<<4 /* 1 Gb half-duplex rate support. */ -+#define OFPPF_1GB_FD 1<<5 /* 1 Gb full-duplex rate support. */ -+#define OFPPF_10GB_FD 1<<6 /* 10 Gb full-duplex rate support. */ -+#define OFPPF_COPPER 1<<7 /* Copper medium. */ -+#define OFPPF_FIBER 1<<8 /* Fiber medium. */ -+#define OFPPF_AUTONEG 1<<9 /* Auto-negotiation. */ -+#define OFPPF_PAUSE 1<<10 /* Pause. */ -+#define OFPPF_PAUSE_ASYM 1<<11 /* Asymmetric pause. */ -+ -+ -+#define OFPAT_OUTPUT 0 /* Output to switch port. */ -+#define OFPAT_SET_VLAN_VID 1 /* Set the 802.1q VLAN id. */ -+#define OFPAT_SET_VLAN_PCP 2 /* Set the 802.1q priority. */ -+#define OFPAT_STRIP_VLAN 3 /* Strip the 802.1q header. */ -+#define OFPAT_SET_DL_SRC 4 /* Ethernet source address. */ -+#define OFPAT_SET_DL_DST 5 /* Ethernet destination address. */ -+#define OFPAT_SET_NW_SRC 6 /* IP source address. */ -+#define OFPAT_SET_NW_DST 7 /* IP destination address. */ -+#define OFPAT_SET_TP_SRC 8 /* TCP/UDP source port. */ -+#define OFPAT_SET_TP_DST 9 /* TCP/UDP destination port. */ -+#define OFPAT_VENDOR 0xffff -+ -+static int -+dissect_openflow_ofp_match_v_1_0(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) -+{ -+ -+ /* uint32_t wildcards; Wildcard fields. */ -+ proto_tree_add_item(tree, hf_openflow_wildcards, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ /* uint16_t in_port; Input switch port. */ -+ proto_tree_add_item(tree, hf_openflow_in_port, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ -+ /* uint8_t dl_src[OFP_ETH_ALEN]; Ethernet source address. */ -+ proto_tree_add_item(tree, hf_openflow_eth_src, tvb, offset, 6, ENC_NA); -+ offset+=6; -+ /* uint8_t dl_dst[OFP_ETH_ALEN]; Ethernet destination address. */ -+ proto_tree_add_item(tree, hf_openflow_eth_dst, tvb, offset, 6, ENC_NA); -+ offset+=6; -+ /* uint16_t dl_vlan; Input VLAN id. */ -+ proto_tree_add_item(tree, hf_openflow_dl_vlan, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ /* uint8_t dl_vlan_pcp; Input VLAN priority. */ -+ proto_tree_add_item(tree, hf_openflow_dl_vlan_pcp, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ /* uint8_t pad1[1]; Align to 64-bits */ -+ proto_tree_add_item(tree, hf_openflow_padd8, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ /* uint16_t dl_type; Ethernet frame type. */ -+ /* uint8_t nw_tos; IP ToS (actually DSCP field, 6 bits). */ -+ /* uint8_t nw_proto; IP protocol or lower 8 bits of -+ * ARP opcode. -+ */ -+ /* uint8_t pad2[2]; Align to 64-bits */ -+ /* uint32_t nw_src; IP source address. */ -+ /* uint32_t nw_dst; IP destination address. */ -+ /* uint16_t tp_src; TCP/UDP source port. */ -+ /* uint16_t tp_dst; TCP/UDP destination port. */ -+ proto_tree_add_text(tree, tvb, offset, 18, "Data not dissected yet"); -+ offset +=18; -+ -+ return offset; -+} -+ -+ -+static const value_string openflow_action_values[] = { -+ { OFPAT_OUTPUT, "Output to switch port" }, -+ { OFPAT_SET_VLAN_VID, "Set the 802.1q VLAN id" }, -+ { OFPAT_SET_VLAN_PCP, "Set the 802.1q priority" }, -+ { OFPAT_STRIP_VLAN, "Strip the 802.1q header" }, -+ { OFPAT_SET_DL_SRC, "Ethernet source address" }, -+ { OFPAT_SET_DL_DST, "Ethernet destination address" }, -+ { OFPAT_SET_NW_SRC, "IP source address" }, -+ { OFPAT_SET_NW_DST, "IP destination address" }, -+ { OFPAT_SET_TP_SRC, "TCP/UDP source port" }, -+ { OFPAT_SET_TP_DST, "TCP/UDP destination port" }, -+ { OFPAT_VENDOR, "Vendor specific action"}, -+ { 0, NULL } -+}; -+ -+static int -+dissect_openflow_action_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) -+{ -+ guint16 action_type, action_len; -+ -+ /* uint16_t type; One of OFPAT_*. */ -+ action_type = tvb_get_ntohs(tvb, offset); -+ proto_tree_add_item(tree, hf_openflow_action_type, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ /* Length of action, including this -+ * header. This is the length of action, -+ * including any padding to make it -+ * 64-bit aligned. -+ */ -+ action_len = tvb_get_ntohs(tvb, offset); -+ proto_tree_add_item(tree, hf_openflow_action_len, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ -+ switch(action_type){ -+ case OFPAT_OUTPUT: -+ /* uint16_t port; Output port. */ -+ proto_tree_add_item(tree, hf_openflow_output_port, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ /* uint16_t max_len; Max length to send to controller. */ -+ proto_tree_add_item(tree, hf_openflow_max_len, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ break; -+ default: -+ proto_tree_add_text(tree, tvb, offset, action_len-4, "Action not dissected yet"); -+ offset+=(action_len-4); -+ break; -+ } -+ -+ return offset; -+} -+static void -+dissect_openflow_phy_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) -+{ -+ proto_item *ti; -+ proto_tree *port_cnf_tree, *port_state_tree, *port_cf_tree; -+ -+ proto_tree_add_item(tree, hf_openflow_port_no, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ proto_tree_add_item(tree, hf_openflow_hw_addr, tvb, offset, 6, ENC_NA); -+ offset+=6; -+ proto_tree_add_item(tree, hf_openflow_port_name, tvb, offset, OFP_MAX_PORT_NAME_LEN, ENC_ASCII|ENC_NA); -+ offset+=OFP_MAX_PORT_NAME_LEN; -+ -+ /* Bitmap of OFPPC_* flags. */ -+ ti = proto_tree_add_item(tree, hf_openflow_port_config, tvb, offset, 4, ENC_BIG_ENDIAN); -+ port_cnf_tree = proto_item_add_subtree(ti, ett_openflow_port_cnf); -+ -+ /* Port is administratively down. */ -+ proto_tree_add_item(port_cnf_tree, hf_openflow_port_down, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Disable 802.1D spanning tree on port. */ -+ proto_tree_add_item(port_cnf_tree, hf_openflow_no_stp, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Drop all packets except 802.1D spanning tree packets. */ -+ proto_tree_add_item(port_cnf_tree, hf_openflow_no_recv, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Drop received 802.1D STP packets. */ -+ proto_tree_add_item(port_cnf_tree, hf_openflow_no_recv_stp, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Do not include this port when flooding. */ -+ proto_tree_add_item(port_cnf_tree, hf_openflow_no_flood, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Drop packets forwarded to port. */ -+ proto_tree_add_item(port_cnf_tree, hf_openflow_no_fwd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Do not send packet-in msgs for port. */ -+ proto_tree_add_item(port_cnf_tree, hf_openflow_no_packet_in, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ -+ /* Bitmap of OFPPS_* flags. */ -+ ti = proto_tree_add_item(tree, hf_openflow_port_state, tvb, offset, 4, ENC_BIG_ENDIAN); -+ port_state_tree = proto_item_add_subtree(ti, ett_openflow_port_state); -+ -+ /* No physical link present. */ -+ proto_tree_add_item(port_state_tree, hf_openflow_link_down, tvb, offset, 4, ENC_BIG_ENDIAN); -+ -+ offset+=4; -+ -+ /* Current features. */ -+ ti = proto_tree_add_item(tree, hf_openflow_port_curr, tvb, offset, 4, ENC_BIG_ENDIAN); -+ port_cf_tree = proto_item_add_subtree(ti, ett_port_cf); -+ /* 10 Mb half-duplex rate support. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* 10 Mb full-duplex rate support. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* 100 Mb half-duplex rate support. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* 100 Mb full-duplex rate support. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* 1 Gb half-duplex rate support. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* 1 Gb full-duplex rate support. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* 10 Gb full-duplex rate support. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Copper medium. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_copper, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Fiber medium. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_fiber, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Auto-negotiation. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Pause. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_pause, tvb, offset, 4, ENC_BIG_ENDIAN); -+ /* Asymmetric pause. */ -+ proto_tree_add_item(port_cf_tree, hf_openflow_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ -+ /* Features being advertised by the port. */ -+ proto_tree_add_item(tree, hf_openflow_port_advertised, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ -+ /* Features supported by the port. */ -+ proto_tree_add_item(tree, hf_openflow_port_supported, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ /* Features advertised by peer. */ -+ proto_tree_add_item(tree, hf_openflow_port_peer, tvb, offset, 4, ENC_BIG_ENDIAN); -+ -+ -+} -+/* -+ * Switch features. -+ * -+ struct ofp_switch_features { -+ struct ofp_header header; -+ uint64_t datapath_id; * Datapath unique ID. The lower 48-bits are for -+ a MAC address, while the upper 16-bits are -+ implementer-defined. * -+ uint32_t n_buffers; * Max packets buffered at once. * -+ uint8_t n_tables; * Number of tables supported by datapath. * -+ uint8_t pad[3]; * Align to 64-bits. * -+* Features. * -+ uint32_t capabilities; * Bitmap of support "ofp_capabilities". * -+ uptill 1.1 -+ uint32_t actions; * Bitmap of supported "ofp_action_type"s. * -+ from 1.2 -+ uint32_t reserved; -+* Port info.* -+ struct ofp_phy_port ports[0]; * Port definitions. The number of ports -+ is inferred from the length field in -+ the header. -+ }; -+*/ -+static void -+dissect_openflow_features_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint8 version, guint16 length) -+{ -+ proto_item *ti; -+ proto_tree *path_id_tree, *cap_tree, *act_tree; -+ -+ guint16 length_remaining; -+ -+ ti = proto_tree_add_item(tree, hf_openflow_datapath_id, tvb, offset, 8, ENC_BIG_ENDIAN); -+ path_id_tree = proto_item_add_subtree(ti, ett_openflow_path_id); -+ proto_tree_add_item(path_id_tree, hf_openflow_datapath_mac, tvb, offset, 6, ENC_NA); -+ offset+=6; -+ proto_tree_add_item(path_id_tree, hf_openflow_datapath_impl, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ -+ proto_tree_add_item(tree, hf_openflow_n_buffers, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ -+ proto_tree_add_item(tree, hf_openflow_n_tables, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ -+ if(version < OFP_VERSION_1_2){ -+ proto_tree_add_item(tree, hf_openflow_pad3, tvb, offset, 3, ENC_BIG_ENDIAN); -+ offset+=3; -+ }else{ -+ } -+ -+ ti = proto_tree_add_item(tree, hf_openflow_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN); -+ cap_tree = proto_item_add_subtree(ti, ett_openflow_cap); -+ -+ /* Dissect flags */ -+ proto_tree_add_item(cap_tree, hf_openflow_cap_flow_stats, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(cap_tree, hf_openflow_table_stats, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(cap_tree, hf_openflow_port_stats, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(cap_tree, hf_openflow_group_stats, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(cap_tree, hf_openflow_ip_reasm, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(cap_tree, hf_openflow_queue_stats, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(cap_tree, hf_openflow_port_blocked, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ -+ if(version < OFP_VERSION_1_1){ -+ ti = proto_tree_add_item(tree, hf_openflow_actions, tvb, offset, 4, ENC_BIG_ENDIAN); -+ act_tree = proto_item_add_subtree(ti, ett_openflow_act); -+ /* Dissect flags */ -+ proto_tree_add_item(act_tree, hf_openflow_output, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_vlan_vid, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_vlan_pcp, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_strip_vlan, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_dl_src, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_dl_dst, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_nw_src, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_nw_dst, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_nw_tos, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_tp_src, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_set_tp_dst, tvb, offset, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(act_tree, hf_openflow_enqueue, tvb, offset, 4, ENC_BIG_ENDIAN); -+ }else{ -+ proto_tree_add_item(tree, hf_openflow_reserved32, tvb, offset, 4, ENC_BIG_ENDIAN); -+ } -+ offset+=4; -+ -+ length_remaining = length-32; -+ if(length_remaining > 0){ -+ guint16 num_ports = length_remaining/48; -+ int i; -+ if ((length_remaining&0x003f) != 0){ -+ /* protocol_error */ -+ } -+ for(i=0; i OFP_VERSION_1_2){ -+ /* uint8_t table_id; ID of the table that was looked up */ -+ proto_tree_add_item(tree, hf_openflow_table_id, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ /* uint64_t cookie; Cookie of the flow entry that was looked up. */ -+ proto_tree_add_item(tree, hf_openflow_cookie, tvb, offset, 8, ENC_BIG_ENDIAN); -+ offset+=8; -+ /* Followed by: -+ * - Exactly 2 all-zero padding bytes, then -+ * - An Ethernet frame whose length is inferred from header.length. -+ * The padding bytes preceding the Ethernet frame ensure that the IP -+ * header (if any) following the Ethernet header is 32-bit aligned. -+ */ -+ proto_tree_add_item(tree, hf_openflow_padd16, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ }else{ -+ proto_tree_add_item(tree, hf_openflow_padd8, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset+=1; -+ } -+ -+ /*proto_tree_add_text(tree, tvb, offset, length-offset, "Offset=%u, remaining %u", offset, length-offset);*/ -+ next_tvb = tvb_new_subset(tvb, offset, length-offset, length-offset); -+ call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); -+ -+} -+ -+static void -+dissect_openflow_pkt_out(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint8 version, guint16 length _U_) -+{ -+ tvbuff_t *next_tvb; -+ gint32 buffer_id; -+ -+ /* uint32_t buffer_id; ID assigned by datapath. */ -+ buffer_id = tvb_get_ntohl(tvb, offset); -+ proto_tree_add_item(tree, hf_openflow_buffer_id, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ -+ /* uint32_t in_port; Packet's input port or OFPP_CONTROLLER. */ -+ proto_tree_add_item(tree, hf_openflow_in_port, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ -+ /* uint16_t actions_len; Size of action array in bytes. */ -+ proto_tree_add_item(tree, hf_openflow_actions_len, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ -+ if(version > OFP_VERSION_1_2){ -+ /* uint8_t pad[6]; */ -+ proto_tree_add_item(tree, hf_openflow_padd48, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=6; -+ } -+ /* struct ofp_action_header actions[0]; Action list. */ -+ offset = dissect_openflow_action_header(tvb, pinfo, tree, offset); -+ /* Packet data. The length is inferred -+ from the length field in the header. -+ (Only meaningful if buffer_id == -1.) -+ */ -+ if(buffer_id == -1){ -+ /* proto_tree_add_text(tree, tvb, offset, -1, "Packet data"); */ -+ next_tvb = tvb_new_subset(tvb, offset, length-offset, length-offset); -+ call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); -+ } -+} -+ -+#define OFPFC_ADD 0 /* New flow. */ -+#define OFPFC_MODIFY 1 /* Modify all matching flows. */ -+#define OFPFC_MODIFY_STRICT 2 /* Modify entry strictly matching wildcards */ -+#define OFPFC_DELETE 3 /* Delete all matching flows. */ -+#define OFPFC_DELETE_STRICT 4 /* Strictly match wildcards and priority. */ -+ -+static const value_string openflow_command_values[] = { -+ { OFPFC_ADD, "New flow" }, -+ { OFPFC_MODIFY, "Modify all matching flows" }, -+ { OFPFC_MODIFY_STRICT, "Modify entry strictly matching wildcards" }, -+ { OFPFC_DELETE, "Delete all matching flows" }, -+ { OFPFC_DELETE_STRICT, "Strictly match wildcards and priority" }, -+ { 0, NULL } -+}; -+ -+static void -+dissect_openflow_flow_mod(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint8 version, guint16 length _U_) -+{ -+ -+ /* struct ofp_match match; Fields to match */ -+ if(version < OFP_VERSION_1_2){ -+ offset = dissect_openflow_ofp_match_v_1_0(tvb, pinfo, tree, offset); -+ } -+ -+ /* uint64_t cookie; Opaque controller-issued identifier. */ -+ proto_tree_add_item(tree, hf_openflow_cookie, tvb, offset, 8, ENC_BIG_ENDIAN); -+ offset+=8; -+ if(version > OFP_VERSION_1_2){ -+ /* uint64_t cookie_mask; Mask used to restrict the cookie bits -+ * that must match when the command is -+ * OFPFC_MODIFY* or OFPFC_DELETE*. A value -+ * of 0 indicates no restriction. -+ */ -+ proto_tree_add_item(tree, hf_openflow_cookie_mask, tvb, offset, 8, ENC_BIG_ENDIAN); -+ offset+=8; -+ /* Flow actions. */ -+ /* uint8_t table_id; ID of the table to put the flow in. -+ For OFPFC_DELETE_* commands, OFPTT_ALL can also be used to delete matching -+ flows from all tables. -+ */ -+ proto_tree_add_item(tree, hf_openflow_table_id, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ } -+ if(version > OFP_VERSION_1_2){ -+ /* uint8_t command; One of OFPFC_*. */ -+ proto_tree_add_item(tree, hf_openflow_command, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ }else{ -+ /* uint16_t command; One of OFPFC_*. */ -+ proto_tree_add_item(tree, hf_openflow_command, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ } -+ /* uint16_t idle_timeout; Idle time before discarding (seconds). */ -+ proto_tree_add_item(tree, hf_openflow_idle_timeout, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ /* uint16_t hard_timeout; Max time before discarding (seconds). */ -+ proto_tree_add_item(tree, hf_openflow_hard_timeout, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ /* uint16_t priority; Priority level of flow entry. */ -+ proto_tree_add_item(tree, hf_openflow_priority, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ /* uint32_t buffer_id; Buffered packet to apply to, or OFP_NO_BUFFER. -+ Not meaningful for OFPFC_DELETE*. -+ */ -+ proto_tree_add_item(tree, hf_openflow_buffer_id, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ /* uint32_t out_port; For OFPFC_DELETE* commands, require -+ matching entries to include this as an output port. A value of OFPP_ANY -+ indicates no restriction. -+ */ -+ if(version > OFP_VERSION_1_2){ -+ proto_tree_add_item(tree, hf_openflow_out_port, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ }else{ -+ proto_tree_add_item(tree, hf_openflow_out_port, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ } -+ -+ if(version > OFP_VERSION_1_2){ -+ /* uint32_t out_group; For OFPFC_DELETE* commands, require -+ matching entries to include this as an -+ output group. A value of OFPG_ANY -+ indicates no restriction. -+ */ -+ proto_tree_add_item(tree, hf_openflow_out_group, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ } -+ /* uint16_t flags; One of OFPFF_*. */ -+ proto_tree_add_item(tree, hf_openflow_flags, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ if(version > OFP_VERSION_1_2){ -+ /* uint8_t pad[2]; */ -+ proto_tree_add_item(tree, hf_openflow_padd16, tvb, offset, 2, ENC_BIG_ENDIAN); -+ } -+ -+#if 0 -+ offset+=2; -+ if(version < OFP_VERSION_1_2){ -+ /* The action length is inferred -+ from the length field in the -+ header. */ -+ /*struct ofp_action_header actions[0]; */ -+ }else{ -+ /* struct ofp_match match; Fields to match. Variable size. */ -+ } -+#endif -+} -+/* Code to actually dissect the packets */ -+static int -+dissect_openflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) -+{ -+ proto_item *ti; -+ proto_tree *openflow_tree; -+ guint offset = 0; -+ guint8 type, version; -+ guint16 length; -+ -+ -+ version = tvb_get_guint8(tvb, 0); -+ type = tvb_get_guint8(tvb, 1); -+ /* Set the Protocol column to the constant string of openflow */ -+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OpenFlow"); -+ col_clear(pinfo->cinfo,COL_INFO); -+ -+ if((version&0x80)==0x80){ -+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OpenFlow experimental version"); -+ proto_tree_add_text(tree, tvb, offset, -1, "Experimental versions not dissected"); -+ }else{ -+ version = version & 0x7f; -+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OpenFlow"); -+ col_append_fstr(pinfo->cinfo, COL_INFO, "Type: %s", -+ val_to_str_const(type, openflow_type_values, "Unknown Messagetype")); -+ } -+ /* Stop the Ethernet frame from overwriting the columns */ -+ if((type == OFPT_PACKET_IN) || (type == OFPT_PACKET_OUT)){ -+ col_set_writable(pinfo->cinfo, FALSE); -+ } -+ -+ /* Create display subtree for the protocol */ -+ ti = proto_tree_add_item(tree, proto_openflow, tvb, 0, -1, ENC_NA); -+ openflow_tree = proto_item_add_subtree(ti, ett_openflow); -+ -+ /* A.1 OpenFlow Header. */ -+ /* OFP_VERSION. */ -+ proto_tree_add_item(openflow_tree, hf_openflow_version, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ -+ /* One of the OFPT_ constants. */ -+ proto_tree_add_item(openflow_tree, hf_openflow_type, tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset++; -+ -+ /* Length including this ofp_header. */ -+ length = tvb_get_ntohs(tvb, offset); -+ proto_tree_add_item(openflow_tree, hf_openflow_length, tvb, offset, 2, ENC_BIG_ENDIAN); -+ offset+=2; -+ -+ /* Transaction id associated with this packet. Replies use the same id as was in the request -+ * to facilitate pairing. -+ */ -+ proto_tree_add_item(openflow_tree, hf_openflow_xid, tvb, offset, 4, ENC_BIG_ENDIAN); -+ offset+=4; -+ -+ switch(type){ -+ case OFPT_HELLO: /* 0 */ -+ /* 5.5.1 Hello -+ * The OFPT_HELLO message has no body; -+ */ -+ break; -+ case OFPT_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. -+ */ -+ break; -+ case OFPT_FEATURES_REPLY: /* 6 */ -+ dissect_openflow_features_reply(tvb, pinfo, openflow_tree, offset, version, length); -+ break; -+ case OFPT_GET_CONFIG_REQUEST: /* 7 */ -+ /* A.3.2 There is no body for OFPT_GET_CONFIG_REQUEST beyond the OpenFlow header. */ -+ break; -+ case OFPT_GET_CONFIG_REPLY: /* 8 */ -+ /* Fall trough */ -+ case OFPT_SET_CONFIG: /* 9 */ -+ dissect_openflow_switch_config(tvb, pinfo, openflow_tree, offset, version, length); -+ break; -+ case OFPT_PACKET_IN: /* 10 */ -+ dissect_openflow_pkt_in(tvb, pinfo, openflow_tree, offset, version, length); -+ break; -+ case OFPT_PACKET_OUT: /* 13 */ -+ dissect_openflow_pkt_out(tvb, pinfo, openflow_tree, offset, version, length); -+ break; -+ case OFPT_FLOW_MOD: /* 14 */ -+ dissect_openflow_flow_mod(tvb, pinfo, openflow_tree, offset, version, length); -+ break; -+ default: -+ if(length>8){ -+ proto_tree_add_text(tree, tvb, offset, -1, "Message data not dissected yet"); -+ } -+ break; -+ } -+ -+ return tvb_length(tvb); -+} -+ -+/* Register the protocol with Wireshark. -+ * -+ * This format is require because a script is used to build the C function that -+ * calls all the protocol registration. -+ */ -+void -+proto_register_openflow(void) -+{ -+ module_t *openflow_module; -+ -+ static hf_register_info hf[] = { -+ { &hf_openflow_version, -+ { "Version", "openflow.version", -+ FT_UINT8, BASE_HEX, VALS(openflow_version_values), 0x7f, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_type, -+ { "Type", "openflow.type", -+ FT_UINT8, BASE_DEC, VALS(openflow_type_values), 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_xid, -+ { "Transaction ID", "openflow.xid", -+ FT_UINT32, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_length, -+ { "Length", "openflow.length", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_datapath_id, -+ { "Datapath unique ID", "openflow.datapath_id", -+ FT_UINT64, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_datapath_mac, -+ { "MAC addr", "openflow.datapath_mac", -+ FT_ETHER, BASE_NONE, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_datapath_impl, -+ { "Implementers part", "openflow.datapath_imp", -+ FT_UINT16, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_n_buffers, -+ { "n_buffers", "openflow.n_buffers", -+ FT_UINT32, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_n_tables, -+ { "n_tables", "openflow.n_tables", -+ FT_UINT8, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_pad3, -+ { "Padding", "openflow.pad3", -+ FT_UINT24, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_capabilities, -+ { "capabilities", "openflow.capabilities", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_actions, -+ { "actions", "openflow.actions", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_reserved32, -+ { "Reserved", "openflow.reserved32", -+ FT_UINT32, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_cap_flow_stats, -+ { "Flow statistics", "openflow.flow_stats", -+ FT_BOOLEAN, 32, NULL, OFPC_FLOW_STATS, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_table_stats, -+ { "Table statistics", "openflow.table_stats", -+ FT_BOOLEAN, 32, NULL, OFPC_TABLE_STATS, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_stats, -+ { "Port statistics", "openflow.port_stats", -+ FT_BOOLEAN, 32, NULL, OFPC_PORT_STATS, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_group_stats, -+ { "Group statistics", "openflow.group_stats", -+ FT_BOOLEAN, 32, NULL, OFPC_GROUP_STATS, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_ip_reasm, -+ { "Can reassemble IP fragments", "openflow.ip_reasm", -+ FT_BOOLEAN, 32, NULL, OFPC_IP_REASM, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_queue_stats, -+ { "Queue statistics", "openflow.queue_stats", -+ FT_BOOLEAN, 32, NULL, OFPC_QUEUE_STATS, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_blocked, -+ { "Switch will block looping ports", "openflow.port_blocked", -+ FT_BOOLEAN, 32, NULL, OFPC_PORT_BLOCKED, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_output, -+ { "Output to switch port", "openflow.output", -+ FT_BOOLEAN, 32, NULL, OFPAT_OUTPUT_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_vlan_vid, -+ { "Set the 802.1q VLAN id", "openflow.set_vlan_vid", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_VLAN_VID_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_vlan_pcp, -+ { "Set the 802.1q priority", "openflow.set_vlan_pcp", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_VLAN_PCP_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_strip_vlan, -+ { "Strip the 802.1q header", "openflow.strip_vlan", -+ FT_BOOLEAN, 32, NULL, OFPAT_STRIP_VLAN_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_dl_src, -+ { "Ethernet source address", "openflow.set_dl_src", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_DL_SRC_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_dl_dst, -+ { "Ethernet destination address", "openflow.set_dl_ds", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_DL_DST_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_nw_src, -+ { "IP source address", "openflow.set_nw_src", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_NW_SRC_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_nw_dst, -+ { "IP destination address", "openflow.set_nw_ds", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_NW_DST_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_nw_tos, -+ { "IP ToS (DSCP field, 6 bits)", "openflow.set_nw_tos", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_NW_TOS_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_tp_src, -+ { "TCP/UDP source port", "openflow.set_tp_src", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_TP_SRC_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_set_tp_dst, -+ { "TCP/UDP destination port", "openflow.set_tp_dst", -+ FT_BOOLEAN, 32, NULL, OFPAT_SET_TP_DST_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_enqueue, -+ { "Output to queue", "openflow.enqueue", -+ FT_BOOLEAN, 32, NULL, OFPAT_ENQUEUE_MASK, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_no, -+ { "Port number", "openflow.port_no", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_hw_addr, -+ { "HW Address", "openflow.hw_add", -+ FT_ETHER, BASE_NONE, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_name, -+ { "Name", "openflow.hw_add", -+ FT_STRING, BASE_NONE, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_config, -+ { "Config flags", "openflow.port_config", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_state, -+ { "State flags", "openflow.port_state", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_curr, -+ { "Current features", "openflow.port_curr", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_advertised, -+ { "Advertised features", "openflow.port_advertised", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_supported, -+ { "Features supported", "openflow.port_supported", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_peer, -+ { "Features advertised by peer", "openflow.port_peer", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_port_down, -+ { "Port is administratively down", "openflow.port_down", -+ FT_BOOLEAN, 32, NULL, OFPPC_PORT_DOWN, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_no_stp, -+ { "Disable 802.1D spanning tree on port", "openflow.no_stp", -+ FT_BOOLEAN, 32, NULL, OFPPC_NO_STP, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_no_recv, -+ { "Drop all packets except 802.1D spanning tree packets", "openflow.no_recv", -+ FT_BOOLEAN, 32, NULL, OFPPC_NO_RECV, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_no_recv_stp, -+ { "Drop received 802.1D STP packets", "openflow.no_recv", -+ FT_BOOLEAN, 32, NULL, OFPPC_NO_RECV_STP, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_no_flood, -+ { "Do not include this port when flooding", "openflow.no_flood", -+ FT_BOOLEAN, 32, NULL, OFPPC_NO_FLOOD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_no_fwd, -+ { "Drop packets forwarded to port", "openflow.no_fwd", -+ FT_BOOLEAN, 32, NULL, OFPPC_NO_FWD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_no_packet_in, -+ { "Do not send packet-in msgs for port", "openflow.no_packet_in", -+ FT_BOOLEAN, 32, NULL, OFPPC_NO_PACKET_IN, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_link_down, -+ { "No physical link present", "openflow.link_down", -+ FT_BOOLEAN, 32, NULL, OFPPS_LINK_DOWN, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_10mb_hd, -+ { "10 Mb half-duplex rate support", "openflow.10mb_hd", -+ FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_10mb_fd, -+ { "10 Mb full-duplex rate support", "openflow.10mb_fd", -+ FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_100mb_hd, -+ { "100 Mb half-duplex rate support", "openflow.100mb_hd", -+ FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_100mb_fd, -+ { "100 Mb full-duplex rate support", "openflow.100mb_0fd", -+ FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_1gb_hd, -+ { "1 Gb half-duplex rate support", "openflow.1gb_hd", -+ FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_1gb_fd, -+ { "1 Gb full-duplex rate support", "openflow.1gb_fd", -+ FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_10gb_fd, -+ { "10 Gb full-duplex rate support", "openflow.10gb_fd", -+ FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_copper, -+ { "Copper medium", "openflow.copper", -+ FT_BOOLEAN, 32, NULL, OFPPF_COPPER, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_fiber, -+ { "Fiber medium", "openflow.fiber", -+ FT_BOOLEAN, 32, NULL, OFPPF_FIBER, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_autoneg, -+ { "Auto-negotiation", "openflow.autoneg", -+ FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_pause, -+ { "Pause", "openflow.pause", -+ FT_BOOLEAN, 32, NULL, OFPPF_PAUSE, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_pause_asym, -+ { "Asymmetric pause", "openflow.pause_asym", -+ FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_config_flags, -+ { "Config flags", "openflow.config_flags", -+ FT_UINT16, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_miss_send_len, -+ { "Max bytes of packet", "openflow.miss_send_len", -+ FT_UINT16, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_buffer_id, -+ { "Buffser Id", "openflow.buffer_id", -+ FT_UINT32, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_total_len, -+ { "Total length", "openflow.total_len", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_in_port, -+ { "In port", "openflow.in_port", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_reason, -+ { "Reason", "openflow.reason", -+ FT_UINT8, BASE_DEC, VALS(openflow_reason_values), 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_table_id, -+ { "Table Id", "openflow.table_id", -+ FT_UINT8, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_cookie, -+ { "Cookie", "openflow.cookie", -+ FT_UINT64, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_cookie_mask, -+ { "Cookie mask", "openflow.cookie", -+ FT_UINT64, BASE_HEX, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_padd8, -+ { "Padding", "openflow.padding8", -+ FT_UINT8, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_padd16, -+ { "Padding", "openflow.padding16", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_padd48, -+ { "Padding", "openflow.padding48", -+ FT_UINT64, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_actions_len, -+ { "Actions length", "openflow.actions_len", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_action_type, -+ { "Actions type", "openflow.action_typ", -+ FT_UINT16, BASE_DEC, VALS(openflow_action_values), 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_action_len, -+ { "Action length", "openflow.action_len", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_output_port, -+ { "Output port", "openflow.output_port", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_max_len, -+ { "Max length", "openflow.max_len", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_wildcards, -+ { "Wildcards", "openflow.wildcards", -+ FT_UINT32, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_command, -+ { "Command", "openflow.command", -+ FT_UINT16, BASE_DEC, VALS(openflow_command_values), 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_eth_src, -+ { "Ethernet source address", "openflow.eth_src", -+ FT_ETHER, BASE_NONE, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_eth_dst, -+ { "Ethernet destination address", "openflow.eth_src", -+ FT_ETHER, BASE_NONE, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_dl_vlan, -+ { "Input VLAN id", "openflow.dl_vlan", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_dl_vlan_pcp, -+ { "Input VLAN priority", "openflow.dl_vlan_pcp", -+ FT_UINT8, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_idle_timeout, -+ { "Idle time-out", "openflow.idle_timeout", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_hard_timeout, -+ { "hard time-out", "openflow.hard_timeout", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_priority, -+ { "Priority", "openflow.priority", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_out_port, -+ { "Out port", "openflow.out_port", -+ FT_UINT32, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_out_group, -+ { "Out group", "openflow.out_group", -+ FT_UINT32, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ { &hf_openflow_flags, -+ { "Flags", "openflow.flags", -+ FT_UINT16, BASE_DEC, NULL, 0x0, -+ NULL, HFILL } -+ }, -+ }; -+ -+ static gint *ett[] = { -+ &ett_openflow, -+ &ett_openflow_path_id, -+ &ett_openflow_cap, -+ &ett_openflow_act, -+ &ett_openflow_port, -+ &ett_openflow_port_cnf, -+ &ett_openflow_port_state, -+ &ett_port_cf -+ }; -+ -+ /* Register the protocol name and description */ -+ proto_openflow = proto_register_protocol("OpenFlow", -+ "openflow", "openflow"); -+ -+ /* Required function calls to register the header fields and subtrees */ -+ proto_register_field_array(proto_openflow, hf, array_length(hf)); -+ proto_register_subtree_array(ett, array_length(ett)); -+ -+ openflow_module = prefs_register_protocol(proto_openflow, proto_reg_handoff_openflow); -+ -+ /* Register port preference */ -+ prefs_register_uint_preference(openflow_module, "tcp.port", "openflow TCP Port", -+ " openflow TCP port if other than the default", -+ 10, &g_openflow_port); -+} -+ -+void -+proto_reg_handoff_openflow(void) -+{ -+ static gboolean initialized = FALSE; -+ static dissector_handle_t openflow_handle; -+ static int currentPort; -+ -+ if (!initialized) { -+ openflow_handle = new_create_dissector_handle(dissect_openflow, proto_openflow); -+ initialized = TRUE; -+ -+ } else { -+ dissector_delete_uint("tcp.port", currentPort, openflow_handle); -+ } -+ -+ currentPort = g_openflow_port; -+ -+ dissector_add_uint("tcp.port", currentPort, openflow_handle); -+ eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); -+ -+} -+ -+ -+/* -+ * 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 --git a/wireshark-0008-adds-autoconf-macro-file.patch b/wireshark-0008-adds-autoconf-macro-file.patch deleted file mode 100644 index 5c1818d..0000000 --- a/wireshark-0008-adds-autoconf-macro-file.patch +++ /dev/null @@ -1,113 +0,0 @@ -From: =?UTF-8?q?Radek=20Vok=C3=A1l?= -Date: Mon, 21 Dec 2009 11:19:39 +0000 -Subject: [PATCH] adds autoconf macro file - -updated autoconf macros and pkgconfig file in wireshark-devel to reflect current config.h Resolves: #746655 - -diff --git a/wireshark-autoconf.m4 b/wireshark-autoconf.m4 -new file mode 100644 -index 0000000..d8015d8 ---- /dev/null -+++ b/wireshark-autoconf.m4 -@@ -0,0 +1,101 @@ -+dnl AM_PATH_WIRESHARK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -+dnl Test for wireshark development files, and define WIRESHARK_CFLAGS, -+dnl WIRESHARK_LIBS and WIRESHARK_VERSION. -+dnl -+AC_DEFUN([AM_PATH_WIRESHARK],[ -+ AC_ARG_WITH(wireshark-prefix, -+ [ --with-wireshark-prefix=PFX Prefix where wireshark libraries are installed (optional)], -+ wireshark_config_prefix="$withval", wireshark_config_prefix="") -+ -+ wireshark_found=no -+ if test "$wireshark_config_prefix" != "" ; then -+ AM_PATH_GLIB_2_0(,,,[gmodule]) -+ WIRESHARK_CFLAGS="-DWS_VAR_IMPORT=extern -DWS_MSVC_NORETURN= -I$wireshark_config_prefix/include/wireshark -I$wireshark_config_prefix/include/wireshark/epan -I/usr/include/wireshark -I/usr/include/wireshark/epan $GLIB_CFLAGS" -+ WIRESHARK_LIBS="-L$wireshark_config_prefix/lib -lwireshark -lwiretap $GLIB_LIBS" -+ wireshark_found=yes -+ else -+ PKG_PROG_PKG_CONFIG() -+ PKG_CHECK_MODULES(WIRESHARK, wireshark, wireshark_found=yes) -+ fi -+ -+ ac_save_CFLAGS="$CFLAGS" -+ ac_save_CLIBS="$LIBS" -+ CFLAGS="$CFLAGS $WIRESHARK_CFLAGS" -+ LIBS="$WIRESHARK_LIBS $LIBS" -+ min_wireshark_version=ifelse([$1], ,0.0.0,[$1]) -+ if test $wireshark_found = yes; then -+ AC_MSG_CHECKING(for wireshark version >= $min_wireshark_version) -+ wireshark_found=no -+ AC_TRY_RUN([ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+int -+main() -+ -+{ -+ int ws_major_version, ws_minor_version, ws_micro_version; -+ int major, minor, micro; -+ char **tmp_version; -+ -+ tmp_version = (char *) strdup("$min_wireshark_version"); -+ major = 0; -+ minor = 0; -+ micro = 0; -+ sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ); -+ free(tmp_version); -+ tmp_version = (char *) epan_get_version(); -+ sscanf(tmp_version, "%d.%d.%d", -+ &ws_major_version, &ws_minor_version, &ws_micro_version); -+ -+ if (ws_major_version > major || -+ (ws_major_version == major && ws_minor_version > minor) || -+ (ws_major_version == major && ws_minor_version == minor && -+ ws_micro_version >= micro)) -+ return 0; -+ -+ printf("\n*** An old version of wireshark (%d.%d.%d) was found.\n", -+ ws_major_version, ws_minor_version, ws_micro_version); -+ printf("*** You need a version of wireshark not older than %d.%d.%d. ", -+ major, minor, micro); -+ return 1; -+} -+ ], wireshark_found=yes) -+ fi -+ -+ if test "$wireshark_found" != no; then -+ AC_LANG_PUSH(C) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([ -+#include -+#include -+#include -+#include -+#include -+#include -+], [puts(epan_get_version());])], [WIRESHARK_VERSION=`./conftest$ac_exeext`], -+wireshark_found=no) -+ -+ AC_LANG_POP -+ fi -+ -+ CFLAGS="$ac_save_CFLAGS" -+ LIBS="$ac_save_LIBS" -+ -+ if test "$wireshark_found" != no; then -+ AC_MSG_RESULT(yes) -+ ifelse([$2],, :, [$2]) -+ else -+ AC_MSG_RESULT(no) -+ WIRESHARK_CFLAGS="" -+ WIRESHARK_LIBS="" -+ WIRESHARK_VERSION="" -+ ifelse([$3], , :, [$3]) -+ fi -+ AC_SUBST(WIRESHARK_CFLAGS) -+ AC_SUBST(WIRESHARK_LIBS) -+ AC_SUBST(WIRESHARK_VERSION) -+]) diff --git a/wireshark-0008-move-default-temporary-directory-to-var-tmp.patch b/wireshark-0008-move-default-temporary-directory-to-var-tmp.patch new file mode 100644 index 0000000..9378f72 --- /dev/null +++ b/wireshark-0008-move-default-temporary-directory-to-var-tmp.patch @@ -0,0 +1,223 @@ +From: Peter Hatina +Date: Tue, 24 Sep 2013 10:55:09 +0200 +Subject: [PATCH] move default temporary directory to /var/tmp + +Conflicts: + wsutil/Makefile.common + wsutil/filesystem.c + wsutil/tempfile.c + +Change-Id: I881c17e1fa3cb292dabe7612bc06748cccfcfcda + +diff --git a/ui/gtk/proto_help.c b/ui/gtk/proto_help.c +index 6de7daa..a644615 100644 +--- a/ui/gtk/proto_help.c ++++ b/ui/gtk/proto_help.c +@@ -42,6 +42,8 @@ + #include + #include + ++#include /* for get_tmp_dir() */ ++ + #include "ui/gtk/proto_help.h" + + /* +@@ -160,7 +162,7 @@ void proto_help_init(void) + /* Start loop */ + + #ifdef PH_DEBUG_LOG +- ph_log_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), PH_FILE_LOG); ++ ph_log_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_tmp_dir(), PH_FILE_LOG); + #endif + + for (i = 0; i < PH_CONF_DIRS; i++) { +diff --git a/wsutil/Makefile.common b/wsutil/Makefile.common +index 75c31bd..81648a7 100644 +--- a/wsutil/Makefile.common ++++ b/wsutil/Makefile.common +@@ -62,7 +62,8 @@ LIBWSUTIL_SRC = \ + time_util.c \ + type_util.c \ + u3.c \ +- unicode-utils.c ++ unicode-utils.c \ ++ wstmpdir.c + + # Header files that are not generated from other files + LIBWSUTIL_INCLUDES = \ +@@ -104,4 +105,5 @@ LIBWSUTIL_INCLUDES = \ + time_util.h \ + type_util.h \ + u3.h \ +- unicode-utils.h ++ unicode-utils.h \ ++ wstmpdir.h +diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c +index ccefe30..ac40319 100644 +--- a/wsutil/tempfile.c ++++ b/wsutil/tempfile.c +@@ -48,6 +48,7 @@ + + #include "tempfile.h" + #include ++#include /* For get_tmp_dir() */ + + #ifndef __set_errno + #define __set_errno(x) errno=(x) +@@ -150,7 +151,7 @@ mkdtemp (char *template) + */ + char *get_tempfile_path(const char *filename) + { +- return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename); ++ return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_tmp_dir(), filename); + } + + #define MAX_TEMPFILES 3 +@@ -207,7 +208,7 @@ create_tempfile(char **namebuf, const char *pfx) + tf[idx].path = (char *)g_malloc(tf[idx].len); + } + +- tmp_dir = g_get_tmp_dir(); ++ tmp_dir = get_tmp_dir(); + + #ifdef _WIN32 + _tzset(); +@@ -241,7 +242,7 @@ create_tempfile(char **namebuf, const char *pfx) + + /** + * Create a directory with the given prefix (e.g. "wireshark"). The path +- * is created using g_get_tmp_dir and mkdtemp. ++ * is created using get_tmp_dir and mkdtemp. + * + * @param namebuf + * @param pfx A prefix for the temporary directory. +@@ -269,7 +270,7 @@ create_tempdir(char **namebuf, const char *pfx) + /* + * We can't use get_tempfile_path here because we're called from dumpcap.c. + */ +- tmp_dir = g_get_tmp_dir(); ++ tmp_dir = get_tmp_dir(); + + while (g_snprintf(td_path[idx], td_path_len[idx], "%s%c%s" TMP_FILE_SUFFIX, tmp_dir, G_DIR_SEPARATOR, pfx) > td_path_len[idx]) { + td_path_len[idx] *= 2; +diff --git a/wsutil/wstmpdir.c b/wsutil/wstmpdir.c +new file mode 100644 +index 0000000..d8b733b +--- /dev/null ++++ b/wsutil/wstmpdir.c +@@ -0,0 +1,70 @@ ++/* wstmpdir.c ++ * ++ * Copyright (C) 2013 Red Hat, Inc. All right reserved. ++ * ++ * Temporary directory routine ++ * ++ * 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. ++ * ++ * Author: Peter Hatina ++ */ ++ ++#include "config.h" ++ ++#include ++#include "wstmpdir.h" ++ ++/** ++ * Gets the directory to use for temporary files. ++ * ++ * Inspired by glib-2.0. If no TMP, TEMP or TMPDIR is set, ++ * /var/tmp is returned (Fedora specific). ++ * ++ * Returns: the directory to use for temporary files. ++ */ ++const char *get_tmp_dir(void) ++{ ++ static gchar *tmp_dir; ++ ++ if (g_once_init_enter(&tmp_dir)) { ++ gchar *tmp; ++ ++ tmp = g_strdup(g_getenv("TEMP")); ++ if (tmp == NULL || *tmp == '\0') { ++ g_free(tmp); ++ tmp = g_strdup(g_getenv("TMPDIR")); ++ } ++ ++#ifdef P_tmpdir ++ if (tmp == NULL || *tmp == '\0') { ++ gsize k; ++ g_free(tmp); ++ tmp = g_strdup(P_tmpdir); ++ k = strlen(tmp); ++ if (k > 1 && G_IS_DIR_SEPARATOR(tmp[k - 1])) ++ tmp[k - 1] = '\0'; ++ } ++#endif /* P_tmpdir */ ++ ++ if (tmp == NULL || *tmp == '\0') { ++ g_free(tmp); ++ tmp = g_strdup("/var/tmp"); ++ } ++ ++ g_once_init_leave(&tmp_dir, tmp); ++ } ++ ++ return tmp_dir; ++} +diff --git a/wsutil/wstmpdir.h b/wsutil/wstmpdir.h +new file mode 100644 +index 0000000..021b615 +--- /dev/null ++++ b/wsutil/wstmpdir.h +@@ -0,0 +1,39 @@ ++/* wstmpdir.c ++ * ++ * Copyright (C) 2013 Red Hat, Inc. All right reserved. ++ * ++ * Temporary directory routine ++ * ++ * 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. ++ * ++ * Author: Peter Hatina ++ */ ++ ++#ifndef __WS_TMP_DIR_H__ ++#define __WS_TMP_DIR_H__ ++ ++#include "ws_symbol_export.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif // __cplusplus ++ ++WS_DLL_PUBLIC const char *get_tmp_dir(void); ++ ++#ifdef __cplusplus ++} ++#endif // __cplusplus ++ ++#endif // __WS_TMP_DIR_H__ diff --git a/wireshark-0009-Fix-paths-in-a-wireshark.desktop-file.patch b/wireshark-0009-Fix-paths-in-a-wireshark.desktop-file.patch new file mode 100644 index 0000000..227669a --- /dev/null +++ b/wireshark-0009-Fix-paths-in-a-wireshark.desktop-file.patch @@ -0,0 +1,20 @@ +From: Kenneth Soerensen +Date: Wed, 29 Jan 2014 16:04:12 +0400 +Subject: [PATCH] Fix paths in a wireshark.desktop file + + +diff --git a/wireshark.desktop b/wireshark.desktop +index 828eca7..eef3503 100644 +--- a/wireshark.desktop ++++ b/wireshark.desktop +@@ -69,8 +69,8 @@ Comment[fi]=Verkkoliikenne analysaattori + Comment[fr]=Analyseur de trafic réseau + Comment[sv]=Nätverkstrafikanalysator + Icon=wireshark +-TryExec=wireshark +-Exec=wireshark %f ++TryExec=/usr/sbin/wireshark ++Exec=/usr/sbin/wireshark %f + Terminal=false + MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view; + # Category entry according to: diff --git a/wireshark-0009-Restore-Fedora-specific-groups.patch b/wireshark-0009-Restore-Fedora-specific-groups.patch deleted file mode 100644 index 7d8fca4..0000000 --- a/wireshark-0009-Restore-Fedora-specific-groups.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Peter Lemenkov -Date: Fri, 13 Sep 2013 14:36:55 +0400 -Subject: [PATCH] Restore Fedora-specific groups - -Signed-off-by: Peter Lemenkov - -diff --git a/wireshark.desktop b/wireshark.desktop -index b0fe1ae..d275887 100644 ---- a/wireshark.desktop -+++ b/wireshark.desktop -@@ -76,4 +76,4 @@ Terminal=false - MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view; - # Category entry according to: - # http://standards.freedesktop.org/menu-spec/1.0/ --Categories=System;Monitor;GTK; -+Categories=Application;Network;GTK; diff --git a/wireshark-0010-Add-pkgconfig-entry.patch b/wireshark-0010-Add-pkgconfig-entry.patch deleted file mode 100644 index 3128658..0000000 --- a/wireshark-0010-Add-pkgconfig-entry.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: =?UTF-8?q?Radek=20Vok=C3=A1l?= -Date: Thu, 17 Dec 2009 09:17:07 +0000 -Subject: [PATCH] Add pkgconfig entry - - -diff --git a/Makefile.am b/Makefile.am -index f3e313c..07efc02 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -50,6 +50,9 @@ bin_PROGRAMS = \ - EXTRA_PROGRAMS = wireshark tshark capinfos editcap mergecap dftest \ - randpkt text2pcap dumpcap reordercap rawshark wireshark_cxx - -+pkgconfigdir = $(libdir)/pkgconfig -+pkgconfig_DATA = wireshark.pc -+ - # - # Wireshark configuration files are put in $(pkgdatadir). - # -diff --git a/configure.ac b/configure.ac -index 488d8d0..0c1ed4d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2549,6 +2549,7 @@ AC_CONFIG_HEADERS(config.h) - AC_OUTPUT( - Makefile - doxygen.cfg -+ wireshark.pc - asn1/Makefile - _CUSTOM_ASN1_AC_OUTPUT_ - asn1/acp133/Makefile -diff --git a/wireshark.pc.in b/wireshark.pc.in -new file mode 100644 -index 0000000..2e2fcdc ---- /dev/null -+++ b/wireshark.pc.in -@@ -0,0 +1,11 @@ -+prefix=@prefix@ -+exec_prefix=@exec_prefix@ -+libdir=@libdir@ -+includedir=@includedir@ -+ -+Name: wireshark -+Description: Network Traffic Analyzer -+Version: @PACKAGE_VERSION@ -+Requires: glib-2.0 gmodule-2.0 -+Libs: -L@libdir@ -lwireshark -lwiretap -+Cflags: -DWS_VAR_IMPORT=extern -DHAVE_STDARG_H -DWS_MSVC_NORETURN= -I@includedir@/wireshark -I@includedir@/wireshark/epan diff --git a/wireshark-0011-Install-autoconf-related-file.patch b/wireshark-0011-Install-autoconf-related-file.patch deleted file mode 100644 index f40dc14..0000000 --- a/wireshark-0011-Install-autoconf-related-file.patch +++ /dev/null @@ -1,233 +0,0 @@ -From: Peter Lemenkov -Date: Fri, 13 Sep 2013 15:25:12 +0400 -Subject: [PATCH] Install autoconf-related file - - -diff --git a/Makefile.am b/Makefile.am -index 07efc02..2ce4527 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -53,6 +53,9 @@ EXTRA_PROGRAMS = wireshark tshark capinfos editcap mergecap dftest \ - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = wireshark.pc - -+autoconfigdir = $(datadir)/aclocal -+autoconfig_DATA = wireshark.m4 -+ - # - # Wireshark configuration files are put in $(pkgdatadir). - # -diff --git a/wireshark-autoconf.m4 b/wireshark-autoconf.m4 -deleted file mode 100644 -index d8015d8..0000000 ---- a/wireshark-autoconf.m4 -+++ /dev/null -@@ -1,101 +0,0 @@ --dnl AM_PATH_WIRESHARK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) --dnl Test for wireshark development files, and define WIRESHARK_CFLAGS, --dnl WIRESHARK_LIBS and WIRESHARK_VERSION. --dnl --AC_DEFUN([AM_PATH_WIRESHARK],[ -- AC_ARG_WITH(wireshark-prefix, -- [ --with-wireshark-prefix=PFX Prefix where wireshark libraries are installed (optional)], -- wireshark_config_prefix="$withval", wireshark_config_prefix="") -- -- wireshark_found=no -- if test "$wireshark_config_prefix" != "" ; then -- AM_PATH_GLIB_2_0(,,,[gmodule]) -- WIRESHARK_CFLAGS="-DWS_VAR_IMPORT=extern -DWS_MSVC_NORETURN= -I$wireshark_config_prefix/include/wireshark -I$wireshark_config_prefix/include/wireshark/epan -I/usr/include/wireshark -I/usr/include/wireshark/epan $GLIB_CFLAGS" -- WIRESHARK_LIBS="-L$wireshark_config_prefix/lib -lwireshark -lwiretap $GLIB_LIBS" -- wireshark_found=yes -- else -- PKG_PROG_PKG_CONFIG() -- PKG_CHECK_MODULES(WIRESHARK, wireshark, wireshark_found=yes) -- fi -- -- ac_save_CFLAGS="$CFLAGS" -- ac_save_CLIBS="$LIBS" -- CFLAGS="$CFLAGS $WIRESHARK_CFLAGS" -- LIBS="$WIRESHARK_LIBS $LIBS" -- min_wireshark_version=ifelse([$1], ,0.0.0,[$1]) -- if test $wireshark_found = yes; then -- AC_MSG_CHECKING(for wireshark version >= $min_wireshark_version) -- wireshark_found=no -- AC_TRY_RUN([ --#include --#include --#include --#include --#include --#include -- --int --main() -- --{ -- int ws_major_version, ws_minor_version, ws_micro_version; -- int major, minor, micro; -- char **tmp_version; -- -- tmp_version = (char *) strdup("$min_wireshark_version"); -- major = 0; -- minor = 0; -- micro = 0; -- sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ); -- free(tmp_version); -- tmp_version = (char *) epan_get_version(); -- sscanf(tmp_version, "%d.%d.%d", -- &ws_major_version, &ws_minor_version, &ws_micro_version); -- -- if (ws_major_version > major || -- (ws_major_version == major && ws_minor_version > minor) || -- (ws_major_version == major && ws_minor_version == minor && -- ws_micro_version >= micro)) -- return 0; -- -- printf("\n*** An old version of wireshark (%d.%d.%d) was found.\n", -- ws_major_version, ws_minor_version, ws_micro_version); -- printf("*** You need a version of wireshark not older than %d.%d.%d. ", -- major, minor, micro); -- return 1; --} -- ], wireshark_found=yes) -- fi -- -- if test "$wireshark_found" != no; then -- AC_LANG_PUSH(C) -- AC_LINK_IFELSE([AC_LANG_PROGRAM([ --#include --#include --#include --#include --#include --#include --], [puts(epan_get_version());])], [WIRESHARK_VERSION=`./conftest$ac_exeext`], --wireshark_found=no) -- -- AC_LANG_POP -- fi -- -- CFLAGS="$ac_save_CFLAGS" -- LIBS="$ac_save_LIBS" -- -- if test "$wireshark_found" != no; then -- AC_MSG_RESULT(yes) -- ifelse([$2],, :, [$2]) -- else -- AC_MSG_RESULT(no) -- WIRESHARK_CFLAGS="" -- WIRESHARK_LIBS="" -- WIRESHARK_VERSION="" -- ifelse([$3], , :, [$3]) -- fi -- AC_SUBST(WIRESHARK_CFLAGS) -- AC_SUBST(WIRESHARK_LIBS) -- AC_SUBST(WIRESHARK_VERSION) --]) -diff --git a/wireshark.m4 b/wireshark.m4 -new file mode 100644 -index 0000000..d8015d8 ---- /dev/null -+++ b/wireshark.m4 -@@ -0,0 +1,101 @@ -+dnl AM_PATH_WIRESHARK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -+dnl Test for wireshark development files, and define WIRESHARK_CFLAGS, -+dnl WIRESHARK_LIBS and WIRESHARK_VERSION. -+dnl -+AC_DEFUN([AM_PATH_WIRESHARK],[ -+ AC_ARG_WITH(wireshark-prefix, -+ [ --with-wireshark-prefix=PFX Prefix where wireshark libraries are installed (optional)], -+ wireshark_config_prefix="$withval", wireshark_config_prefix="") -+ -+ wireshark_found=no -+ if test "$wireshark_config_prefix" != "" ; then -+ AM_PATH_GLIB_2_0(,,,[gmodule]) -+ WIRESHARK_CFLAGS="-DWS_VAR_IMPORT=extern -DWS_MSVC_NORETURN= -I$wireshark_config_prefix/include/wireshark -I$wireshark_config_prefix/include/wireshark/epan -I/usr/include/wireshark -I/usr/include/wireshark/epan $GLIB_CFLAGS" -+ WIRESHARK_LIBS="-L$wireshark_config_prefix/lib -lwireshark -lwiretap $GLIB_LIBS" -+ wireshark_found=yes -+ else -+ PKG_PROG_PKG_CONFIG() -+ PKG_CHECK_MODULES(WIRESHARK, wireshark, wireshark_found=yes) -+ fi -+ -+ ac_save_CFLAGS="$CFLAGS" -+ ac_save_CLIBS="$LIBS" -+ CFLAGS="$CFLAGS $WIRESHARK_CFLAGS" -+ LIBS="$WIRESHARK_LIBS $LIBS" -+ min_wireshark_version=ifelse([$1], ,0.0.0,[$1]) -+ if test $wireshark_found = yes; then -+ AC_MSG_CHECKING(for wireshark version >= $min_wireshark_version) -+ wireshark_found=no -+ AC_TRY_RUN([ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+int -+main() -+ -+{ -+ int ws_major_version, ws_minor_version, ws_micro_version; -+ int major, minor, micro; -+ char **tmp_version; -+ -+ tmp_version = (char *) strdup("$min_wireshark_version"); -+ major = 0; -+ minor = 0; -+ micro = 0; -+ sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ); -+ free(tmp_version); -+ tmp_version = (char *) epan_get_version(); -+ sscanf(tmp_version, "%d.%d.%d", -+ &ws_major_version, &ws_minor_version, &ws_micro_version); -+ -+ if (ws_major_version > major || -+ (ws_major_version == major && ws_minor_version > minor) || -+ (ws_major_version == major && ws_minor_version == minor && -+ ws_micro_version >= micro)) -+ return 0; -+ -+ printf("\n*** An old version of wireshark (%d.%d.%d) was found.\n", -+ ws_major_version, ws_minor_version, ws_micro_version); -+ printf("*** You need a version of wireshark not older than %d.%d.%d. ", -+ major, minor, micro); -+ return 1; -+} -+ ], wireshark_found=yes) -+ fi -+ -+ if test "$wireshark_found" != no; then -+ AC_LANG_PUSH(C) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([ -+#include -+#include -+#include -+#include -+#include -+#include -+], [puts(epan_get_version());])], [WIRESHARK_VERSION=`./conftest$ac_exeext`], -+wireshark_found=no) -+ -+ AC_LANG_POP -+ fi -+ -+ CFLAGS="$ac_save_CFLAGS" -+ LIBS="$ac_save_LIBS" -+ -+ if test "$wireshark_found" != no; then -+ AC_MSG_RESULT(yes) -+ ifelse([$2],, :, [$2]) -+ else -+ AC_MSG_RESULT(no) -+ WIRESHARK_CFLAGS="" -+ WIRESHARK_LIBS="" -+ WIRESHARK_VERSION="" -+ ifelse([$3], , :, [$3]) -+ fi -+ AC_SUBST(WIRESHARK_CFLAGS) -+ AC_SUBST(WIRESHARK_LIBS) -+ AC_SUBST(WIRESHARK_VERSION) -+]) diff --git a/wireshark-0012-move-default-temporary-directory-to-var-tmp.patch b/wireshark-0012-move-default-temporary-directory-to-var-tmp.patch deleted file mode 100644 index 9b64428..0000000 --- a/wireshark-0012-move-default-temporary-directory-to-var-tmp.patch +++ /dev/null @@ -1,230 +0,0 @@ -From: Peter Hatina -Date: Tue, 24 Sep 2013 10:55:09 +0200 -Subject: [PATCH] move default temporary directory to /var/tmp - - -diff --git a/epan/filesystem.c b/epan/filesystem.c -index 053711d..adf3b91 100644 ---- a/epan/filesystem.c -+++ b/epan/filesystem.c -@@ -74,6 +74,8 @@ - - #include /* for WTAP_ERR_SHORT_WRITE */ - -+#include /* for get_tmp_dir() */ -+ - #define PROFILES_DIR "profiles" - #define PLUGINS_DIR_NAME "plugins" - -@@ -1574,7 +1576,7 @@ deletefile(const char *path) - */ - char *get_tempfile_path(const char *filename) - { -- return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename); -+ return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_tmp_dir(), filename); - } - - /* -diff --git a/tempfile.c b/tempfile.c -index 2fab0df..10ab3e6 100644 ---- a/tempfile.c -+++ b/tempfile.c -@@ -50,6 +50,7 @@ - - #include "tempfile.h" - #include -+#include /* For get_tmp_dir() */ - - #ifndef __set_errno - #define __set_errno(x) errno=(x) -@@ -203,7 +204,7 @@ create_tempfile(char **namebuf, const char *pfx) - /* - * We can't use get_tempfile_path here because we're called from dumpcap.c. - */ -- tmp_dir = g_get_tmp_dir(); -+ tmp_dir = get_tmp_dir(); - - #ifdef _WIN32 - _tzset(); -@@ -237,7 +238,7 @@ create_tempfile(char **namebuf, const char *pfx) - - /** - * Create a directory with the given prefix (e.g. "wireshark"). The path -- * is created using g_get_tmp_dir and mkdtemp. -+ * is created using get_tmp_dir and mkdtemp. - * - * @param namebuf - * @param pfx A prefix for the temporary directory. -@@ -265,7 +266,7 @@ create_tempdir(char **namebuf, const char *pfx) - /* - * We can't use get_tempfile_path here because we're called from dumpcap.c. - */ -- tmp_dir = g_get_tmp_dir(); -+ tmp_dir = get_tmp_dir(); - - while (g_snprintf(td_path[idx], td_path_len[idx], "%s%c%s" TMP_FILE_SUFFIX, tmp_dir, G_DIR_SEPARATOR, pfx) > td_path_len[idx]) { - td_path_len[idx] *= 2; -diff --git a/ui/gtk/proto_help.c b/ui/gtk/proto_help.c -index bbf5fe0..9998a22 100644 ---- a/ui/gtk/proto_help.c -+++ b/ui/gtk/proto_help.c -@@ -44,6 +44,8 @@ - #include - #include - -+#include /* for get_tmp_dir() */ -+ - #include "ui/gtk/proto_help.h" - - /* -@@ -162,7 +164,7 @@ void proto_help_init(void) - /* Start loop */ - - #ifdef PH_DEBUG_LOG -- ph_log_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), PH_FILE_LOG); -+ ph_log_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_tmp_dir(), PH_FILE_LOG); - #endif - - for (i = 0; i < PH_CONF_DIRS; i++) { -diff --git a/wsutil/Makefile.common b/wsutil/Makefile.common -index 570dbe6..7a33f5b 100644 ---- a/wsutil/Makefile.common -+++ b/wsutil/Makefile.common -@@ -43,7 +43,8 @@ LIBWSUTIL_SRC = \ - mpeg-audio.c \ - privileges.c \ - str_util.c \ -- type_util.c -+ type_util.c \ -+ wstmpdir.c - - # Header files that are not generated from other files - LIBWSUTIL_INCLUDES = \ -@@ -60,4 +61,5 @@ LIBWSUTIL_INCLUDES = \ - mpeg-audio.h \ - privileges.h \ - str_util.h \ -- type_util.h -+ type_util.h \ -+ wstmpdir.h -diff --git a/wsutil/wstmpdir.c b/wsutil/wstmpdir.c -new file mode 100644 -index 0000000..d8b733b ---- /dev/null -+++ b/wsutil/wstmpdir.c -@@ -0,0 +1,70 @@ -+/* wstmpdir.c -+ * -+ * Copyright (C) 2013 Red Hat, Inc. All right reserved. -+ * -+ * Temporary directory routine -+ * -+ * 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. -+ * -+ * Author: Peter Hatina -+ */ -+ -+#include "config.h" -+ -+#include -+#include "wstmpdir.h" -+ -+/** -+ * Gets the directory to use for temporary files. -+ * -+ * Inspired by glib-2.0. If no TMP, TEMP or TMPDIR is set, -+ * /var/tmp is returned (Fedora specific). -+ * -+ * Returns: the directory to use for temporary files. -+ */ -+const char *get_tmp_dir(void) -+{ -+ static gchar *tmp_dir; -+ -+ if (g_once_init_enter(&tmp_dir)) { -+ gchar *tmp; -+ -+ tmp = g_strdup(g_getenv("TEMP")); -+ if (tmp == NULL || *tmp == '\0') { -+ g_free(tmp); -+ tmp = g_strdup(g_getenv("TMPDIR")); -+ } -+ -+#ifdef P_tmpdir -+ if (tmp == NULL || *tmp == '\0') { -+ gsize k; -+ g_free(tmp); -+ tmp = g_strdup(P_tmpdir); -+ k = strlen(tmp); -+ if (k > 1 && G_IS_DIR_SEPARATOR(tmp[k - 1])) -+ tmp[k - 1] = '\0'; -+ } -+#endif /* P_tmpdir */ -+ -+ if (tmp == NULL || *tmp == '\0') { -+ g_free(tmp); -+ tmp = g_strdup("/var/tmp"); -+ } -+ -+ g_once_init_leave(&tmp_dir, tmp); -+ } -+ -+ return tmp_dir; -+} -diff --git a/wsutil/wstmpdir.h b/wsutil/wstmpdir.h -new file mode 100644 -index 0000000..021b615 ---- /dev/null -+++ b/wsutil/wstmpdir.h -@@ -0,0 +1,39 @@ -+/* wstmpdir.c -+ * -+ * Copyright (C) 2013 Red Hat, Inc. All right reserved. -+ * -+ * Temporary directory routine -+ * -+ * 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. -+ * -+ * Author: Peter Hatina -+ */ -+ -+#ifndef __WS_TMP_DIR_H__ -+#define __WS_TMP_DIR_H__ -+ -+#include "ws_symbol_export.h" -+ -+#ifdef __cplusplus -+extern "C" { -+#endif // __cplusplus -+ -+WS_DLL_PUBLIC const char *get_tmp_dir(void); -+ -+#ifdef __cplusplus -+} -+#endif // __cplusplus -+ -+#endif // __WS_TMP_DIR_H__ diff --git a/wireshark-0013-Copy-over-r49999-from-trunk.patch b/wireshark-0013-Copy-over-r49999-from-trunk.patch deleted file mode 100644 index e078a09..0000000 --- a/wireshark-0013-Copy-over-r49999-from-trunk.patch +++ /dev/null @@ -1,60 +0,0 @@ -From: Guy Harris -Date: Thu, 7 Nov 2013 01:54:16 +0000 -Subject: [PATCH] Copy over r49999 from trunk: - - ------------------------------------------------------------------------ - r49999 | eapache | 2013-06-17 18:02:26 -0700 (Mon, 17 Jun 2013) | 10 lines - - Don't limit the on-the-wire length of packets to 64KB, there are larger packets - out there (especially over USB) and we should be able to load them as long as - they are snapped to a sane length. - - Also validate that packets do not specify a snapshot length larger than the one - in the file header, though only make it a warning, as this is not necessarily a - fatally corrupt packet. - - https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8808 - - ------------------------------------------------------------------------ - -Also fixes bug 9390. - -svn path=/trunk-1.10/; revision=53123 - -diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c -index cb9e97c..9601332 100644 ---- a/wiretap/libpcap.c -+++ b/wiretap/libpcap.c -@@ -773,21 +773,8 @@ static int libpcap_read_header(wtap *wth, int *err, gchar **err_info, - return -1; - } - -- if (hdr->hdr.orig_len > WTAP_MAX_PACKET_SIZE) { -- /* -- * Probably a corrupt capture file; return an error, -- * so that our caller doesn't blow up trying to -- * cope with a huge "real" packet length, and so that -- * the code to try to guess what type of libpcap file -- * this is can tell when it's not the type we're guessing -- * it is. -- */ -- *err = WTAP_ERR_BAD_FILE; -- if (err_info != NULL) { -- *err_info = g_strdup_printf("pcap: File has %u-byte packet, bigger than maximum of %u", -- hdr->hdr.orig_len, WTAP_MAX_PACKET_SIZE); -- } -- return -1; -+ if (hdr->hdr.incl_len > wth->snapshot_length) { -+ g_warning("pcap: File has packet larger than file's snapshot length."); - } - - return bytes_read; -@@ -955,7 +942,7 @@ static gboolean libpcap_dump(wtap_dumper *wdh, - rec_hdr.hdr.incl_len = phdr->caplen + phdrsize; - rec_hdr.hdr.orig_len = phdr->len + phdrsize; - -- if (rec_hdr.hdr.incl_len > WTAP_MAX_PACKET_SIZE || rec_hdr.hdr.orig_len > WTAP_MAX_PACKET_SIZE) { -+ if (rec_hdr.hdr.incl_len > WTAP_MAX_PACKET_SIZE) { - *err = WTAP_ERR_BAD_FILE; - return FALSE; - } diff --git a/wireshark-0014-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch b/wireshark-0014-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch deleted file mode 100644 index 3cfb271..0000000 --- a/wireshark-0014-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Pascal Quantin -Date: Sat, 9 Nov 2013 15:44:01 +0000 -Subject: [PATCH] Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9388 - : Avoid an infinite loop in SIP dissector (backport of r51738) - -svn path=/trunk-1.10/; revision=53195 - -diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c -index a3ceec2..b012837 100644 ---- a/epan/dissectors/packet-sip.c -+++ b/epan/dissectors/packet-sip.c -@@ -2134,6 +2134,10 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr - */ - orig_offset = offset; - linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); -+ if(linelen==0){ -+ return -2; -+ } -+ - if (tvb_strnlen(tvb, offset, linelen) > -1) - { - /* diff --git a/wireshark-0015-From-Dirk-Jagdmann-Make-sure-err_str-is-initialized.patch b/wireshark-0015-From-Dirk-Jagdmann-Make-sure-err_str-is-initialized.patch deleted file mode 100644 index 2a11c80..0000000 --- a/wireshark-0015-From-Dirk-Jagdmann-Make-sure-err_str-is-initialized.patch +++ /dev/null @@ -1,19 +0,0 @@ -From: Gerald Combs -Date: Fri, 15 Nov 2013 23:16:14 +0000 -Subject: [PATCH] From Dirk Jagdmann: Make sure err_str is initialized. - -svn path=/trunk-1.10/; revision=53348 - -diff --git a/ui/gtk/main_welcome.c b/ui/gtk/main_welcome.c -index 6de0fea..017f2e4 100644 ---- a/ui/gtk/main_welcome.c -+++ b/ui/gtk/main_welcome.c -@@ -981,7 +981,7 @@ static void fill_capture_box(void) - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - int error = 0; -- gchar *label_text, *err_str; -+ gchar *label_text = NULL, *err_str = NULL; - #ifdef _WIN32 - DWORD reg_ret; - DWORD chimney_enabled = 0; diff --git a/wireshark-0016-Crash-when-selecting-Decode-As-based-on-SCTP-PPID.-B.patch b/wireshark-0016-Crash-when-selecting-Decode-As-based-on-SCTP-PPID.-B.patch deleted file mode 100644 index 48114ea..0000000 --- a/wireshark-0016-Crash-when-selecting-Decode-As-based-on-SCTP-PPID.-B.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Michael Mann -Date: Thu, 28 Nov 2013 16:51:08 +0000 -Subject: [PATCH] Crash when selecting "Decode As" based on SCTP PPID. Bug - 8976 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8976) - -Fixed by defaulting PPID value to LAST_PPID (which should make Decode As a no-op) - -svn path=/trunk-1.10/; revision=53627 - -diff --git a/ui/gtk/decode_as_dlg.c b/ui/gtk/decode_as_dlg.c -index e772099..4e863f1 100644 ---- a/ui/gtk/decode_as_dlg.c -+++ b/ui/gtk/decode_as_dlg.c -@@ -970,7 +970,7 @@ decode_transport(GtkWidget *notebook_pg) - gchar *table_name; - gint requested_srcdst, requested_port, ppid; - gpointer portp; -- gpointer ptr; -+ gpointer ptr = GUINT_TO_POINTER(LAST_PPID); - #ifdef DEBUG - gchar *string; - #endif -@@ -980,8 +980,7 @@ decode_transport(GtkWidget *notebook_pg) - gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(list))); - - combo_box = (GtkWidget *)g_object_get_data(G_OBJECT(notebook_pg), E_COMBO_BOX_SRCDST); -- if (!ws_combo_box_get_active_pointer(GTK_COMBO_BOX(combo_box), &ptr)) -- g_assert_not_reached(); /* Programming error if no active item in combo_box */ -+ ws_combo_box_get_active_pointer(GTK_COMBO_BOX(combo_box), &ptr); - requested_srcdst = GPOINTER_TO_INT(ptr); - - #ifdef DEBUG diff --git a/wireshark-0017-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch b/wireshark-0017-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch deleted file mode 100644 index 2a7832f..0000000 --- a/wireshark-0017-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch +++ /dev/null @@ -1,295 +0,0 @@ -From: Pascal Quantin -Date: Fri, 6 Dec 2013 07:14:45 +0000 -Subject: [PATCH] Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9488 - : Remove global gpinfo variable and use pinfo directly (backport of r49145) - -svn path=/trunk-1.10/; revision=53803 - -diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c -index a89e970..0421cae 100644 ---- a/epan/dissectors/packet-bssgp.c -+++ b/epan/dissectors/packet-bssgp.c -@@ -79,7 +79,6 @@ void proto_reg_handoff_bssgp(void); - static int bssgp_decode_nri = 0; - static guint bssgp_nri_length = 4; - --static packet_info *gpinfo; - static guint8 g_pdu_type, g_rim_application_identity; - static proto_tree *gparent_tree; - static dissector_handle_t llc_handle; -@@ -898,7 +897,7 @@ de_bssgp_flush_action(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g - */ - - static guint16 --de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) -+de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *next_tvb=NULL; - guint32 curr_offset; -@@ -912,10 +911,10 @@ de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint3 - - if(next_tvb){ - if (llc_handle) { -- call_dissector(llc_handle, next_tvb, gpinfo, gparent_tree); -+ call_dissector(llc_handle, next_tvb, pinfo, gparent_tree); - } - else if (data_handle) { -- call_dissector(data_handle, next_tvb, gpinfo, gparent_tree); -+ call_dissector(data_handle, next_tvb, pinfo, gparent_tree); - } - } - -@@ -1100,7 +1099,7 @@ static const value_string bssgp_precedence_dl[] = { - }; - - static guint16 --de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - proto_item *pi, *pre_item; - guint32 curr_offset; -@@ -1113,7 +1112,7 @@ de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, gu - /* octet 3-4 Peak bit rate provided by the network (note) - * NOTE: The bit rate 0 (zero) shall mean "best effort" in this IE. - */ -- link_dir = gpinfo->link_dir; -+ link_dir = pinfo->link_dir; - - peak_bit_rate = tvb_get_ntohs(tvb, curr_offset); - pi = proto_tree_add_text(tree, tvb, curr_offset, 1, "Peak bit rate: "); -@@ -1515,7 +1514,7 @@ de_bssgp_serv_utran_cco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, - * 11.3.48 NSEI (Network Service Entity Identifier) - */ - static guint16 --de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - guint32 curr_offset; - guint16 nsei; -@@ -1526,7 +1525,7 @@ de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o - proto_tree_add_item(tree, hf_bssgp_nsei, tvb, curr_offset, 2, ENC_BIG_ENDIAN); - curr_offset+=2; - -- col_append_sep_fstr(gpinfo->cinfo, COL_INFO, BSSGP_SEP, "NSEI %u", nsei); -+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, BSSGP_SEP, "NSEI %u", nsei); - - - return(curr_offset-offset); -@@ -1535,7 +1534,7 @@ de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o - * 11.3.49 RRLP APDU - */ - static guint16 --de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *next_tvb=NULL; - guint32 curr_offset; -@@ -1555,9 +1554,9 @@ de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guin - - if(next_tvb){ - if (rrlp_handle) { -- call_dissector(rrlp_handle, next_tvb, gpinfo, gparent_tree); -+ call_dissector(rrlp_handle, next_tvb, pinfo, gparent_tree); - }else if (data_handle) { -- call_dissector(data_handle, next_tvb, gpinfo, gparent_tree); -+ call_dissector(data_handle, next_tvb, pinfo, gparent_tree); - } - } - return(len); -@@ -1748,7 +1747,7 @@ de_bssgp_ran_information_request_app_cont(tvbuff_t *tvb, proto_tree *tree, packe - { - asn1_ctx_t asn1_ctx; - -- asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, gpinfo); -+ asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); - /* 11.3.63.1.4 RAN-INFORMATION-REQUEST Application Container for the SON Transfer Application */ - /* Reporting Cell Identifier */ - /* convert to bit offset */ -@@ -1765,7 +1764,7 @@ de_bssgp_ran_information_request_app_cont(tvbuff_t *tvb, proto_tree *tree, packe - * 3GPP TS 25.413 - */ - new_tvb = tvb_new_subset_remaining(tvb, curr_offset); -- curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree, NULL); -+ curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree, NULL); - break; - default : - proto_tree_add_text(tree, tvb, curr_offset, len, "Unknown RIM Application Identity"); -@@ -1847,7 +1846,7 @@ de_bssgp_ran_information_app_cont_unit(tvbuff_t *tvb, proto_tree *tree, packet_i - if (msg_fcn_p == NULL){ - proto_tree_add_text(si_tree, tvb, curr_offset, 21, "Unknown SI message"); - }else{ -- (*msg_fcn_p)(tvb, si_tree, gpinfo, curr_offset+1, 20); -+ (*msg_fcn_p)(tvb, si_tree, pinfo, curr_offset+1, 20); - } - curr_offset+=21; - } -@@ -1895,14 +1894,14 @@ de_bssgp_ran_information_app_cont_unit(tvbuff_t *tvb, proto_tree *tree, packet_i - * Source Cell ID) as defined in 3GPP TS 25.413 - */ - new_tvb = tvb_new_subset_remaining(tvb, curr_offset); -- curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree, NULL); -+ curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree, NULL); - break; - case 2: - /* If the RAT discriminator field indicates E-UTRAN, this field is encoded as the E-UTRAN CGI IE as - * defined in 3GPP TS 36.413 - */ - new_tvb = tvb_new_subset_remaining(tvb, curr_offset); -- curr_offset = curr_offset + dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree, NULL); -+ curr_offset = curr_offset + dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree, NULL); - break; - default: - break; -@@ -1916,7 +1915,7 @@ de_bssgp_ran_information_app_cont_unit(tvbuff_t *tvb, proto_tree *tree, packet_i - * (UTRAN Source Cell ID) as defined in 3GPP TS 25.413 - */ - new_tvb = tvb_new_subset_remaining(tvb, curr_offset); -- curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree, NULL); -+ curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree, NULL); - /* Octet (m+1)-n UTRA SI Container - * UTRA SI Container: This field contains System Information Container valid for the reporting cell - * encoded as defined in TS 25.331 -@@ -1972,7 +1971,7 @@ static const value_string bssgp_utra_si_cause_vals[] = { - }; - - static guint16 --de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *new_tvb = NULL; - guint32 curr_offset; -@@ -2018,7 +2017,7 @@ de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo - * The "SON Transfer Cause" field is encoded as the SON Transfer Cause IE as defined in 3GPP TS 36.413 - */ - new_tvb = tvb_new_subset_remaining(tvb, curr_offset); -- curr_offset = curr_offset + dissect_s1ap_SONtransferCause_PDU(new_tvb, gpinfo, tree, NULL); -+ curr_offset = curr_offset + dissect_s1ap_SONtransferCause_PDU(new_tvb, pinfo, tree, NULL); - /* Erroneous Application Container including IEI and LI */ - proto_tree_add_text(tree, tvb, curr_offset, len-(curr_offset-offset), "Erroneous Application Container including IEI and LI"); - break; -@@ -2212,7 +2211,7 @@ static const value_string bssgp_ra_discriminator_vals[] = { - }; - - static guint16 --de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - guint8 oct; - guint16 rnc_id; -@@ -2261,7 +2260,7 @@ de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_ - curr_offset = curr_offset+ de_emm_trac_area_id(tvb, tree, pinfo, curr_offset, 5, add_string, string_len); - /* Octets 9-n contain the Global eNB ID (see 3GPP TS 36.413 [36]) of the eNodeB. */ - new_tvb = tvb_new_subset_remaining(tvb, curr_offset); -- dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree, NULL); -+ dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree, NULL); - break; - default: - proto_tree_add_text(tree, tvb, curr_offset, 3, "Unknown RIM Routing Address discriminator"); -@@ -2301,7 +2300,7 @@ de_bssgp_mbms_session_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_ - * 11.3.72 MBMS Session Duration - */ - static guint16 --de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *new_tvb; - guint32 curr_offset; -@@ -2310,7 +2309,7 @@ de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U - - /* AVP Code: 904 MBMS-Session-Duration Registered by packet-gtp.c */ - new_tvb =tvb_new_subset(tvb, offset, len, len); -- dissector_try_uint(diameter_3gpp_avp_dissector_table, 904, new_tvb, gpinfo, tree); -+ dissector_try_uint(diameter_3gpp_avp_dissector_table, 904, new_tvb, pinfo, tree); - - return(curr_offset-offset); - } -@@ -2322,7 +2321,7 @@ de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U - * - */ - static guint16 --de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) -+de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *new_tvb; - guint32 curr_offset; -@@ -2331,7 +2330,7 @@ de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, - - /* AVP Code: 903 MBMS-Service-Area Registered by packet-gtp.c */ - new_tvb =tvb_new_subset(tvb, offset, len, len); -- dissector_try_uint(diameter_3gpp_avp_dissector_table, 903, new_tvb, gpinfo, tree); -+ dissector_try_uint(diameter_3gpp_avp_dissector_table, 903, new_tvb, pinfo, tree); - - return(curr_offset-offset); - } -@@ -2840,7 +2839,7 @@ de_bssgp_mbms_session_rep_no(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo - * 11.3.94 Inter RAT Handover Info - */ - static guint16 --de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *new_tvb; - guint32 curr_offset; -@@ -2852,7 +2851,7 @@ de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _ - * Inter RAT Handover Information coded as specified in 3GPP - * Technical Specification 25.331 - */ -- dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, gpinfo, tree, NULL); -+ dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, pinfo, tree, NULL); - - return(len); - } -@@ -3096,7 +3095,7 @@ de_bssgp_enb_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off - - /* Octets 8-n contain the Global eNB ID (see 3GPP TS 36.413) of the eNodeB. */ - new_tvb = tvb_new_subset_remaining(tvb, curr_offset); -- dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree, NULL); -+ dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree, NULL); - - return(len); - } -@@ -3104,7 +3103,7 @@ de_bssgp_enb_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off - * 11.3.104 E-UTRAN Inter RAT Handover Info - */ - static guint16 --de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *new_tvb; - guint32 curr_offset; -@@ -3118,7 +3117,7 @@ de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info - * significant bit of the first octet of the octet string contains bit 8 of - * the first octet of the IE. - */ -- dissect_lte_rrc_UE_EUTRA_Capability_PDU(new_tvb, gpinfo, tree, NULL); -+ dissect_lte_rrc_UE_EUTRA_Capability_PDU(new_tvb, pinfo, tree, NULL); - - return(len); - } -@@ -3181,7 +3180,7 @@ de_bssgp_reliable_inter_rat_ho_inf(tvbuff_t *tvb, proto_tree *tree, packet_info - * 11.3.108 SON Transfer Application Identity - */ - static guint16 --de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset _U_, guint len _U_, gchar *add_string _U_, int string_len _U_) -+de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset _U_, guint len _U_, gchar *add_string _U_, int string_len _U_) - { - tvbuff_t *next_tvb; - -@@ -3190,7 +3189,7 @@ de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo - */ - if(len > 0){ - next_tvb = tvb_new_subset(tvb, offset, len, len); -- dissect_s1ap_SONtransferApplicationIdentity_PDU(next_tvb, gpinfo, tree, NULL); -+ dissect_s1ap_SONtransferApplicationIdentity_PDU(next_tvb, pinfo, tree, NULL); - } - - return(len); -@@ -6370,8 +6369,6 @@ dissect_bssgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) - int hf_idx; - void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len); - -- /* Save pinfo */ -- gpinfo = pinfo; - g_rim_application_identity = 0; - gparent_tree = tree; - len = tvb_length(tvb); diff --git a/wireshark-0018-Copy-over-from-Trunk.patch b/wireshark-0018-Copy-over-from-Trunk.patch deleted file mode 100644 index bb274e7..0000000 --- a/wireshark-0018-Copy-over-from-Trunk.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Bill Meier -Date: Tue, 17 Dec 2013 21:18:15 +0000 -Subject: [PATCH] Copy over from Trunk - - ------------------------------------------------------------------------ - r54181 | wmeier | 2013-12-17 10:02:47 -0500 (Tue, 17 Dec 2013) | 8 lines - - From "bd": Fix " Wireshark stops showing new packets but dumpcap keeps writing them to the temp file" - - https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9571 - - From me: Fixed in a slightly different manner than sugested in the patch attached to the bug. - ------------------------------------------------------------------------ - -svn path=/trunk-1.10/; revision=54196 - -diff --git a/dumpcap.c b/dumpcap.c -index 4d42e71..7098f0c 100644 ---- a/dumpcap.c -+++ b/dumpcap.c -@@ -3653,8 +3653,8 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct - if ((cur_time - upd_time) > DUMPCAP_UPD_TIME) { /* wrap just causes an extra update */ - #else - gettimeofday(&cur_time, NULL); -- if ((cur_time.tv_sec * 1000000 + cur_time.tv_usec) > -- (upd_time.tv_sec * 1000000 + upd_time.tv_usec + DUMPCAP_UPD_TIME*1000)) { -+ if (((guint64)cur_time.tv_sec * 1000000 + cur_time.tv_usec) > -+ ((guint64)upd_time.tv_sec * 1000000 + upd_time.tv_usec + DUMPCAP_UPD_TIME*1000)) { - #endif - - upd_time = cur_time; diff --git a/wireshark-0019-Bugfix-port-number-endianness.-Bug-9530-https-bugs.w.patch b/wireshark-0019-Bugfix-port-number-endianness.-Bug-9530-https-bugs.w.patch deleted file mode 100644 index d5bf7be..0000000 --- a/wireshark-0019-Bugfix-port-number-endianness.-Bug-9530-https-bugs.w.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Michael Mann -Date: Wed, 18 Dec 2013 13:15:13 +0000 -Subject: [PATCH] Bugfix port number endianness. Bug 9530 - (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9530) - -Taken from part of r52609 enhancement. - -svn path=/trunk-1.10/; revision=54217 - -diff --git a/epan/dissectors/packet-bitcoin.c b/epan/dissectors/packet-bitcoin.c -index 5dd9dae..d7467da 100644 ---- a/epan/dissectors/packet-bitcoin.c -+++ b/epan/dissectors/packet-bitcoin.c -@@ -256,7 +256,7 @@ create_address_tree(tvbuff_t *tvb, proto_item *ti, guint32 offset) - offset += 16; - - /* port */ -- proto_tree_add_item(tree, hf_address_port, tvb, offset, 2, ENC_LITTLE_ENDIAN); -+ proto_tree_add_item(tree, hf_address_port, tvb, offset, 2, ENC_BIG_ENDIAN); - - return tree; - } diff --git a/wireshark-0020-Something-went-wrong-with-the-backport-of-r53608-r53.patch b/wireshark-0020-Something-went-wrong-with-the-backport-of-r53608-r53.patch deleted file mode 100644 index 9d17496..0000000 --- a/wireshark-0020-Something-went-wrong-with-the-backport-of-r53608-r53.patch +++ /dev/null @@ -1,81 +0,0 @@ -From: Chris Maynard -Date: Wed, 18 Dec 2013 16:31:29 +0000 -Subject: [PATCH] Something went wrong with the backport of r53608 + r53611. - Fix it. - -svn path=/trunk-1.10/; revision=54225 - -diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c -index 44d5652..db74289 100644 ---- a/ui/gtk/capture_dlg.c -+++ b/ui/gtk/capture_dlg.c -@@ -1019,7 +1019,7 @@ guint32 value) - if (value > (((guint32)G_MAXINT + 1) / 1000)) { - return 0; - } else { -- return value; -+ return value; - } - case(SIZE_UNIT_MEGABYTES): - if (value > (((guint32)G_MAXINT + 1) / (1000 * 1000))) { -@@ -3257,13 +3257,11 @@ static void promisc_mode_callback(GtkToggleButton *button, gpointer d _U_) - GtkTreeIter iter; - GtkTreeView *if_cb; - GtkTreeModel *model; -- gboolean enabled = FALSE, set; -+ gboolean enabled = FALSE; - interface_t device; - interface_options interface_opts; - guint i; - -- set = gtk_toggle_button_get_active(button); -- gtk_toggle_button_set_active(button, (set?FALSE:TRUE)); - if (gtk_toggle_button_get_active(button)) - enabled = TRUE; - -@@ -4489,7 +4487,9 @@ update_properties_all(void) - /* If all selected interfaces are in promiscuous mode, check the global - "promiscuous mode" checkbox, otherwise un-check it. */ - promisc_b = (GtkWidget *)g_object_get_data(G_OBJECT(cap_open_w), E_CAP_PROMISC_KEY_ALL); -+ g_signal_handler_block(promisc_b, promisc_all_handler_id); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(promisc_b), promisc_all); -+ g_signal_handler_unblock(promisc_b, promisc_all_handler_id); - - /* If all selected interfaces have the same filter string, set the - global filter string to it. */ -@@ -5315,7 +5315,7 @@ fprintf(stderr, "Adding the default filter \"%s\"???\n", global_capture_opts.def - - window_get_geometry(top_level, &tl_geom); - gtk_window_set_default_size(GTK_WINDOW(cap_open_w), tl_geom.width * 8 / 10, -1); -- -+ - gtk_widget_show_all(cap_open_w); - window_present(cap_open_w); - -@@ -5356,7 +5356,7 @@ capture_start_cb(GtkWidget *w _U_, gpointer d _U_) - } - success = capture_dlg_prep(cap_open_w); - if (success) -- window_destroy(GTK_WIDGET(cap_open_w)); -+ window_destroy(GTK_WIDGET(cap_open_w)); - if (!success) - return; /* error in options dialog */ - } -@@ -5712,7 +5712,7 @@ create_and_fill_model(GtkTreeView *view) - device.snaplen = WTAP_MAX_PACKET_SIZE; - device.has_snaplen = FALSE; - } -- -+ - if (device.has_snaplen) { - snaplen_string = g_strdup_printf("%d", device.snaplen); - } else { -@@ -5725,7 +5725,7 @@ create_and_fill_model(GtkTreeView *view) - device.buffer = buffer; - } else { - device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE; -- } -+ } - #endif - global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, i); - g_array_insert_val(global_capture_opts.all_ifaces, i, device); diff --git a/wireshark-0021-Remove-g_memmove.patch b/wireshark-0021-Remove-g_memmove.patch deleted file mode 100644 index d6c7073..0000000 --- a/wireshark-0021-Remove-g_memmove.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Peter Lemenkov -Date: Wed, 18 Dec 2013 13:39:07 +0400 -Subject: [PATCH] Remove g_memmove - -Glib no longer offers this macro so we have to fallback to C90 memmove. - -Signed-off-by: Peter Lemenkov - -diff --git a/packaging/macosx/native-gtk/glibconfig.h b/packaging/macosx/native-gtk/glibconfig.h -index e0a9589..2730202 100644 ---- a/packaging/macosx/native-gtk/glibconfig.h -+++ b/packaging/macosx/native-gtk/glibconfig.h -@@ -78,8 +78,6 @@ typedef unsigned long gsize; - # define g_ATEXIT(proc) (atexit (proc)) - #endif - --#define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END -- - #define GLIB_MAJOR_VERSION 2 - #define GLIB_MINOR_VERSION 12 - #define GLIB_MICRO_VERSION 9 diff --git a/wireshark-0022-Fix-IP-types.patch b/wireshark-0022-Fix-IP-types.patch deleted file mode 100644 index 099bfd0..0000000 --- a/wireshark-0022-Fix-IP-types.patch +++ /dev/null @@ -1,299 +0,0 @@ -From: Peter Lemenkov -Date: Fri, 13 Dec 2013 22:10:21 +0400 -Subject: [PATCH] Fix IP types - -Signed-off-by: Peter Lemenkov - -diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c -index e8c5c95..6291de3 100644 ---- a/epan/dissectors/packet-rtpproxy.c -+++ b/epan/dissectors/packet-rtpproxy.c -@@ -40,6 +40,9 @@ - #include - #include - -+#include -+#include -+ - #ifdef HAVE_ARPA_INET_H - #include - #endif -@@ -69,8 +72,8 @@ static int hf_rtpproxy_command = -1; - static int hf_rtpproxy_command_parameters = -1; - static int hf_rtpproxy_command_parameter = -1; - static int hf_rtpproxy_command_parameter_codec = -1; --static int hf_rtpproxy_command_parameter_local = -1; --static int hf_rtpproxy_command_parameter_remote = -1; -+static int hf_rtpproxy_command_parameter_local_ipv4 = -1; -+static int hf_rtpproxy_command_parameter_remote_ipv4 = -1; - static int hf_rtpproxy_command_parameter_repacketize = -1; - static int hf_rtpproxy_command_parameter_dtmf = -1; - /* static int hf_rtpproxy_command_parameter_cmap = -1; TODO */ -@@ -294,8 +297,8 @@ rtpproxy_add_tag(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, guint re - return (end == realsize ? -1 : (gint)end); - } - --void --rtpproxy_add_parameter(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, guint realsize) -+static void -+rtpproxy_add_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_tree, guint begin, guint realsize) - { - proto_item *ti; - proto_tree *another_tree = NULL; -@@ -306,6 +309,7 @@ rtpproxy_add_parameter(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, gu - gchar** codecs = NULL; - guint codec_len; - guint8* rawstr = NULL; -+ guint32 ipaddr[4]; /* Enough room for IPv4 or IPv6 */ - - /* Extract the entire parameters line. */ - /* Something like "t4p1iic8,0,2,4,18,96,97,98,100,101" */ -@@ -338,13 +342,19 @@ rtpproxy_add_parameter(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, gu - case 'l': - new_offset = (gint)strspn(rawstr+offset, "0123456789."); - another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_local); -- proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_local, tvb, begin+offset, new_offset, ENC_ASCII | ENC_NA); -+ if(inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, begin+offset, new_offset), ipaddr)) -+ proto_tree_add_ipv4(another_tree, hf_rtpproxy_command_parameter_local_ipv4, tvb, begin+offset, new_offset, ipaddr[0]); -+ else -+ show_exception(tvb, pinfo, another_tree, DissectorError, "Bogus IPv4"); - offset += new_offset; - break; - case 'r': - new_offset = (gint)strspn(rawstr+offset, "0123456789."); - another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_remote); -- proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_remote, tvb, begin+offset, new_offset, ENC_ASCII | ENC_NA); -+ if(inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, begin+offset, new_offset), ipaddr)) -+ proto_tree_add_ipv4(another_tree, hf_rtpproxy_command_parameter_remote_ipv4, tvb, begin+offset, new_offset, ipaddr[0]); -+ else -+ show_exception(tvb, pinfo, another_tree, DissectorError, "Bogus IPv4"); - offset += new_offset; - break; - case 'z': -@@ -437,12 +447,13 @@ rtpproxy_add_tid(gboolean is_request, tvbuff_t *tvb, packet_info *pinfo, proto_t - return rtpproxy_info; - } - --void --rtpproxy_add_notify_addr(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, guint end) -+static void -+rtpproxy_add_notify_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_tree, guint begin, guint end) - { - gint offset = 0; - gint tmp = 0; - gboolean ipv6 = FALSE; -+ guint32 ipaddr[4]; /* Enough room for IPv4 or IPv6 */ - proto_item *ti; - - /* Check for at least one colon */ -@@ -454,17 +465,28 @@ rtpproxy_add_notify_addr(proto_tree *rtpproxy_tree, tvbuff_t *tvb, guint begin, - offset = tmp; - } - /* We have ip:port */ -- if(ipv6) -- proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, offset - begin, ENC_ASCII | ENC_NA); -- else -- proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, offset - begin, ENC_ASCII | ENC_NA); -+ if(ipv6){ -+ if(inet_pton(AF_INET6, (char*)tvb_get_ephemeral_string(tvb, begin, offset - begin), ipaddr)) -+ proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, offset - begin, (const guint8 *)ipaddr); -+ else -+ show_exception(tvb, pinfo, rtpproxy_tree, DissectorError, "Bogus IPv6"); -+ } -+ else{ -+ if(inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, begin, offset - begin), ipaddr)) -+ proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, offset - begin, ipaddr[0]); -+ else -+ show_exception(tvb, pinfo, rtpproxy_tree, DissectorError, "Bogus IPv4"); -+ } - proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_notify_port, tvb, offset+1, end - (offset+1), - (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, offset+1, end - (offset+1)), NULL, 10)); - } - else{ -- /* Only port is supplied */ -- ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, 0, ENC_ASCII | ENC_NA); -- proto_item_append_text(ti, ""); -+ /* Only port is supplied - take IPv4/IPv6 from ip.src/ipv6.src respectively */ -+ expert_add_info_format(pinfo, rtpproxy_tree, PI_PROTOCOL, PI_WARN, "Only port is supplied - take IPv4/IPv6 from ip.src/ipv6.src respectively"); -+ if (pinfo->src.type == AT_IPv4) -+ ti = proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, 0, ((guint32*)(pinfo->src.data))[0]); -+ else -+ ti = proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, 0, (const guint8 *)(pinfo->src.data)); - PROTO_ITEM_SET_GENERATED(ti); - proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_notify_port, tvb, begin, end - begin, - (guint16) g_ascii_strtoull((gchar*)tvb_get_ephemeral_string(tvb, begin, end - begin), NULL, 10)); -@@ -490,7 +512,7 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data - /* For RT(C)P setup */ - address addr; - guint16 port; -- guint32 ipaddr[4]; -+ guint32 ipaddr[4]; /* Enough room for IPv4 or IPv6 */ - rtpproxy_info_t *rtpproxy_info = NULL; - - /* If it does not start with a printable character it's not RTPProxy */ -@@ -600,7 +622,7 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data - if (new_offset != offset + 1){ - rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_command); - ti2 = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_command_parameters, tvb, offset+1, new_offset - (offset+1), ENC_ASCII | ENC_NA); -- rtpproxy_add_parameter(proto_item_add_subtree(ti2, ett_rtpproxy_command_parameters), tvb, offset+1, new_offset - (offset+1)); -+ rtpproxy_add_parameter(tvb, pinfo, proto_item_add_subtree(ti2, ett_rtpproxy_command_parameters), offset+1, new_offset - (offset+1)); - rtpproxy_tree = proto_item_get_parent(ti); - } - -@@ -623,10 +645,18 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data - if ((tmp == 'u') || (tmp == 'l')){ - /* Extract IP */ - new_offset = tvb_find_guint8(tvb, offset, -1, ' '); -- if (tvb_find_guint8(tvb, offset, new_offset - offset, ':') == -1) -- proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); -- else -- proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); -+ if (tvb_find_guint8(tvb, offset, new_offset - offset, ':') == -1){ -+ if(inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, offset, new_offset - offset), ipaddr)) -+ proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, new_offset - offset, ipaddr[0]); -+ else -+ show_exception(tvb, pinfo, rtpproxy_tree, DissectorError, "Bogus IPv4"); -+ } -+ else{ -+ if(inet_pton(AF_INET6, (char*)tvb_get_ephemeral_string(tvb, offset, new_offset - offset), ipaddr)) -+ proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, new_offset - offset, (const guint8 *)ipaddr); -+ else -+ show_exception(tvb, pinfo, rtpproxy_tree, DissectorError, "Bogus IPv6"); -+ } - /* Skip whitespace */ - offset = tvb_skip_wsp(tvb, new_offset+1, -1); - -@@ -686,12 +716,12 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data - new_offset = tvb_find_guint8(tvb, offset, -1, ' '); - if(new_offset == -1){ - /* NotifyTag wasn't found (we should re-use Call-ID instead) */ -- rtpproxy_add_notify_addr(rtpproxy_tree, tvb, offset, realsize); -+ rtpproxy_add_notify_addr(tvb, pinfo, rtpproxy_tree, offset, realsize); - break; /* No more parameters */ - } - - /* NotifyTag was found */ -- rtpproxy_add_notify_addr(rtpproxy_tree, tvb, offset, new_offset); -+ rtpproxy_add_notify_addr(tvb, pinfo, rtpproxy_tree, offset, new_offset); - /* Skip whitespace */ - offset = tvb_skip_wsp(tvb, new_offset+1, -1); - -@@ -760,29 +790,38 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data - offset = tvb_skip_wsp(tvb, new_offset+1, -1); - - /* Extract IP */ -+ memset(&addr, 0, sizeof(address)); - tmp = tvb_find_line_end(tvb, offset, -1, &new_offset, FALSE); - if (tvb_find_guint8(tvb, offset, -1, ':') == -1){ -- inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, offset, tmp), ipaddr); -- addr.type = AT_IPv4; -- addr.len = 4; -- addr.data = ep_memdup(ipaddr, 4); -- proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, tmp, ENC_ASCII | ENC_NA); -+ if (inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, offset, tmp), ipaddr)){ -+ addr.type = AT_IPv4; -+ addr.len = 4; -+ addr.data = ep_memdup(ipaddr, 4); -+ proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, tmp, ipaddr[0]); -+ } -+ else -+ show_exception(tvb, pinfo, rtpproxy_tree, DissectorError, "Bogus IPv4"); - } - else{ -- inet_pton(AF_INET6, (char*)tvb_get_ephemeral_string(tvb, offset, tmp), ipaddr); -- addr.type = AT_IPv6; -- addr.len = 16; -- addr.data = ep_memdup(ipaddr, 16); -- proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, tmp, ENC_ASCII | ENC_NA); -+ if (inet_pton(AF_INET6, (char*)tvb_get_ephemeral_string(tvb, offset, tmp), ipaddr)){ -+ addr.type = AT_IPv6; -+ addr.len = 16; -+ addr.data = ep_memdup(ipaddr, 16); -+ proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, tmp, (const guint8 *)ipaddr); -+ } -+ else -+ show_exception(tvb, pinfo, rtpproxy_tree, DissectorError, "Bogus IPv6"); - } - - if(rtpproxy_establish_conversation){ - if (rtp_handle) { - /* FIXME tell if isn't a video stream, and setup codec mapping */ -- rtp_add_address(pinfo, &addr, port, 0, "RTPproxy", pinfo->fd->num, 0, NULL); -+ if (addr.len) -+ rtp_add_address(pinfo, &addr, port, 0, "RTPproxy", pinfo->fd->num, 0, NULL); - } - if (rtcp_handle) { -- rtcp_add_address(pinfo, &addr, port+1, 0, "RTPproxy", pinfo->fd->num); -+ if (addr.len) -+ rtcp_add_address(pinfo, &addr, port+1, 0, "RTPproxy", pinfo->fd->num); - } - } - break; -@@ -884,7 +923,7 @@ proto_register_rtpproxy(void) - { - "IPv4", - "rtpproxy.ipv4", -- FT_STRING, -+ FT_IPv4, - BASE_NONE, - NULL, - 0x0, -@@ -897,7 +936,7 @@ proto_register_rtpproxy(void) - { - "IPv6", - "rtpproxy.ipv6", -- FT_STRING, -+ FT_IPv6, - BASE_NONE, - NULL, - 0x0, -@@ -984,11 +1023,11 @@ proto_register_rtpproxy(void) - } - }, - { -- &hf_rtpproxy_command_parameter_local, -+ &hf_rtpproxy_command_parameter_local_ipv4, - { -- "Local IP address", -- "rtpproxy.command_parameter_local", -- FT_STRING, -+ "Local IPv4 address", -+ "rtpproxy.command_parameter_local_ipv4", -+ FT_IPv4, /* FIXME - is it ever possible to see IPv6 here? */ - BASE_NONE, - NULL, - 0x0, -@@ -997,11 +1036,11 @@ proto_register_rtpproxy(void) - } - }, - { -- &hf_rtpproxy_command_parameter_remote, -+ &hf_rtpproxy_command_parameter_remote_ipv4, - { -- "Remote IP address", -- "rtpproxy.command_parameter_remote", -- FT_STRING, -+ "Remote IPv4 address", -+ "rtpproxy.command_parameter_remote_ipv4", -+ FT_IPv4, /* FIXME - is it ever possible to see IPv6 here? */ - BASE_NONE, - NULL, - 0x0, -@@ -1170,7 +1209,7 @@ proto_register_rtpproxy(void) - { - "Notification IPv4", - "rtpproxy.notify_ipv4", -- FT_STRING, -+ FT_IPv4, - BASE_NONE, - NULL, - 0x0, -@@ -1183,7 +1222,7 @@ proto_register_rtpproxy(void) - { - "Notification IPv6", - "rtpproxy.notify_ipv6", -- FT_STRING, -+ FT_IPv6, - BASE_NONE, - NULL, - 0x0, diff --git a/wireshark-0023-Copy-over-r54544-from-trunk.patch b/wireshark-0023-Copy-over-r54544-from-trunk.patch deleted file mode 100644 index 6a306e1..0000000 --- a/wireshark-0023-Copy-over-r54544-from-trunk.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Guy Harris -Date: Wed, 1 Jan 2014 23:24:27 +0000 -Subject: [PATCH] Copy over r54544 from trunk: - - ------------------------------------------------------------------------ - r54544 | guy | 2014-01-01 15:22:53 -0800 (Wed, 01 Jan 2014) | 11 lines - - If the uncompression buffers are empty, they have no data; set the count - of bytes in them to 0, as there's no data in them, and set the offset in - that buffer of the stream's current position, to 0, as we're currently - at the beginning of the file in both streams. - - This fixes some tricky-to-reproduce errors (which show up only if the - ngsniffer_t structure is allocated from data that's been allocated, - written to in those variables, and freed). - -svn path=/trunk-1.10/; revision=54545 - -diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c -index 92e451d..096ee00 100644 ---- a/wiretap/ngsniffer.c -+++ b/wiretap/ngsniffer.c -@@ -740,7 +740,11 @@ ngsniffer_open(wtap *wth, int *err, gchar **err_info) - - /* We haven't allocated any uncompression buffers yet. */ - ngsniffer->seq.buf = NULL; -+ ngsniffer->seq.nbytes = 0; -+ ngsniffer->seq.nextout = 0; - ngsniffer->rand.buf = NULL; -+ ngsniffer->rand.nbytes = 0; -+ ngsniffer->rand.nextout = 0; - - /* Set the current file offset; the offset in the compressed file - and in the uncompressed data stream currently the same. */ diff --git a/wireshark-0024-Fix-paths-in-a-wireshark.desktop-file.patch b/wireshark-0024-Fix-paths-in-a-wireshark.desktop-file.patch deleted file mode 100644 index 52d610a..0000000 --- a/wireshark-0024-Fix-paths-in-a-wireshark.desktop-file.patch +++ /dev/null @@ -1,20 +0,0 @@ -From: Kenneth Soerensen -Date: Wed, 29 Jan 2014 16:04:12 +0400 -Subject: [PATCH] Fix paths in a wireshark.desktop file - - -diff --git a/wireshark.desktop b/wireshark.desktop -index d275887..a72a655 100644 ---- a/wireshark.desktop -+++ b/wireshark.desktop -@@ -70,8 +70,8 @@ Comment[fi]=Verkkoliikenne analysaattori - Comment[fr]=Analyseur de trafic réseau - Comment[sv]=Nätverkstrafikanalysator - Icon=wireshark --TryExec=wireshark --Exec=wireshark %f -+TryExec=/usr/sbin/wireshark -+Exec=/usr/sbin/wireshark %f - Terminal=false - MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view; - # Category entry according to: diff --git a/wireshark-0025-Fix-Capture-Dialog-layout.patch b/wireshark-0025-Fix-Capture-Dialog-layout.patch deleted file mode 100644 index 9d42897..0000000 --- a/wireshark-0025-Fix-Capture-Dialog-layout.patch +++ /dev/null @@ -1,208 +0,0 @@ -From: Peter Hatina -Date: Mon, 3 Mar 2014 12:01:36 +0100 -Subject: [PATCH] Reorganize Capture Dialog layout - -Change-Id: Iafe20f3a8509c83e821ce4abc9bd91bd1bb002dd - -diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c -index a4ef2dc..700f23a 100644 ---- a/ui/gtk/capture_dlg.c -+++ b/ui/gtk/capture_dlg.c -@@ -4637,7 +4637,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - #endif - - swindow = gtk_scrolled_window_new (NULL, NULL); -- gtk_widget_set_size_request(swindow, 676, 180); -+ gtk_widget_set_size_request(swindow, 676, 100); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(swindow), GTK_SHADOW_IN); - - view = gtk_tree_view_new (); -@@ -5044,30 +5044,6 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - - row++; - -- /* Files row */ -- stop_files_cb = gtk_check_button_new_with_label("Stop capture after"); -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_files_cb), -- global_capture_opts.has_autostop_files); -- g_signal_connect(stop_files_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w); -- gtk_widget_set_tooltip_text(stop_files_cb, "Stop capturing after the given number of \"file switches\" have been done."); -- ws_gtk_grid_attach_extended(GTK_GRID (multi_grid), stop_files_cb, 0, row, 1, 1, -- (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); -- -- stop_files_adj = (GtkAdjustment *) gtk_adjustment_new((gfloat)global_capture_opts.autostop_files, -- 1, (gfloat)INT_MAX, 1.0, 10.0, 0.0); -- stop_files_sb = gtk_spin_button_new (stop_files_adj, 0, 0); -- gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_files_sb), TRUE); -- gtk_widget_set_size_request(stop_files_sb, 80, -1); -- ws_gtk_grid_attach_extended(GTK_GRID (multi_grid), stop_files_sb, 1, row, 1, 1, -- (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); -- -- stop_files_lb = gtk_label_new("file(s)"); -- gtk_misc_set_alignment(GTK_MISC(stop_files_lb), 0, 0.5f); -- ws_gtk_grid_attach_extended(GTK_GRID (multi_grid), stop_files_lb, 2, row, 1, 1, -- (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); -- -- row++; -- - /* Capture limits frame */ - limit_fr = frame_new("Stop Capture Automatically After..."); - gtk_box_pack_start(GTK_BOX (left_vb), limit_fr, TRUE, TRUE, 0); -@@ -5107,15 +5083,13 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_packets_lb, 2, row, 1, 1, - (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); - -- row++; -- - /* Filesize row */ - stop_filesize_cb = gtk_check_button_new(); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_filesize_cb), - global_capture_opts.has_autostop_filesize); - g_signal_connect(stop_filesize_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w); - gtk_widget_set_tooltip_text(stop_filesize_cb, "Stop capturing after the specified amount of data has been captured."); -- ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cb, 0, row, 1, 1, -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cb, 3, row, 1, 1, - (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); - - stop_filesize_adj = (GtkAdjustment *) gtk_adjustment_new(0.0, -@@ -5123,11 +5097,11 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - stop_filesize_sb = gtk_spin_button_new (stop_filesize_adj, 0, 0); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_filesize_sb), TRUE); - gtk_widget_set_size_request(stop_filesize_sb, 80, -1); -- ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_sb, 1, row, 1, 1, -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_sb, 4, row, 1, 1, - (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); - - stop_filesize_cbx = size_unit_combo_box_new(global_capture_opts.autostop_filesize); -- ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cbx, 2, row, 1, 1, -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cbx, 5, row, 1, 1, - (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); - - value = size_unit_combo_box_set_value(global_capture_opts.autostop_filesize); -@@ -5135,13 +5109,35 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - - row++; - -+ /* Files row */ -+ stop_files_cb = gtk_check_button_new(); -+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_files_cb), -+ global_capture_opts.has_autostop_files); -+ g_signal_connect(stop_files_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w); -+ gtk_widget_set_tooltip_text(stop_files_cb, "Stop capturing after the given number of \"file switches\" have been done."); -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_files_cb, 0, row, 1, 1, -+ (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); -+ -+ stop_files_adj = (GtkAdjustment *) gtk_adjustment_new((gfloat)global_capture_opts.autostop_files, -+ 1, (gfloat)INT_MAX, 1.0, 10.0, 0.0); -+ stop_files_sb = gtk_spin_button_new (stop_files_adj, 0, 0); -+ gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_files_sb), TRUE); -+ gtk_widget_set_size_request(stop_files_sb, 80, -1); -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_files_sb, 1, row, 1, 1, -+ (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); -+ -+ stop_files_lb = gtk_label_new("file(s)"); -+ gtk_misc_set_alignment(GTK_MISC(stop_files_lb), 0, 0.5f); -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_files_lb, 2, row, 1, 1, -+ (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); -+ - /* Duration row */ - stop_duration_cb = gtk_check_button_new(); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_duration_cb), - global_capture_opts.has_autostop_duration); - g_signal_connect(stop_duration_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w); - gtk_widget_set_tooltip_text(stop_duration_cb, "Stop capturing after the specified amount of time has passed."); -- ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cb, 0, row, 1, 1, -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cb, 3, row, 1, 1, - (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); - - stop_duration_adj = (GtkAdjustment *) gtk_adjustment_new(0.0, -@@ -5149,11 +5145,11 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - stop_duration_sb = gtk_spin_button_new (stop_duration_adj, 0, 0); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_duration_sb), TRUE); - gtk_widget_set_size_request(stop_duration_sb, 80, -1); -- ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_sb, 1, row, 1, 1, -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_sb, 4, row, 1, 1, - (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); - - stop_duration_cbx = time_unit_combo_box_new(global_capture_opts.autostop_duration); -- ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cbx, 2, row, 1, 1, -+ ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cbx, 5, row, 1, 1, - (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0); - - value = time_unit_combo_box_convert_value(global_capture_opts.autostop_duration); -@@ -5164,7 +5160,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - display_fr = frame_new("Display Options"); - gtk_box_pack_start(GTK_BOX (right_vb), display_fr, TRUE, TRUE, 0); - -- display_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_UNRELATED_SPACING, FALSE); -+ display_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_LABEL_SPACING, FALSE); - gtk_container_set_border_width(GTK_CONTAINER(display_vb), DLG_OUTER_MARGIN); - gtk_container_add(GTK_CONTAINER(display_fr), display_vb); - -@@ -5177,7 +5173,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - gtk_widget_set_tooltip_text(sync_cb, - "Using this option will show the captured packets immediately on the main screen. " - "Please note: this will slow down capturing, so increased packet drops might appear."); -- gtk_box_pack_start(GTK_BOX (display_vb), sync_cb, TRUE, TRUE, 0); -+ gtk_box_pack_start(GTK_BOX (display_vb), sync_cb, FALSE, TRUE, 0); - - /* "Auto-scroll live update" row */ - auto_scroll_cb = gtk_check_button_new_with_mnemonic("_Automatically scroll during live capture"); -@@ -5185,19 +5181,19 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - gtk_widget_set_tooltip_text(auto_scroll_cb, - "This will scroll the \"Packet List\" automatically to the latest captured packet, " - "when the \"Update List of packets in real time\" option is used."); -- gtk_box_pack_start(GTK_BOX (display_vb), auto_scroll_cb, TRUE, TRUE, 0); -+ gtk_box_pack_start(GTK_BOX (display_vb), auto_scroll_cb, FALSE, TRUE, 0); - - /* "Hide capture info" row */ - hide_info_cb = gtk_check_button_new_with_mnemonic("_Hide capture info dialog"); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hide_info_cb), !global_capture_opts.show_info); - gtk_widget_set_tooltip_text(hide_info_cb, "Hide the capture info dialog while capturing."); -- gtk_box_pack_start(GTK_BOX (display_vb), hide_info_cb, TRUE, TRUE, 0); -+ gtk_box_pack_start(GTK_BOX (display_vb), hide_info_cb, FALSE, TRUE, 0); - - /* Name Resolution frame */ - resolv_fr = frame_new("Name Resolution"); - gtk_box_pack_start(GTK_BOX (right_vb), resolv_fr, TRUE, TRUE, 0); - -- resolv_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_UNRELATED_SPACING, FALSE); -+ resolv_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_LABEL_SPACING, FALSE); - gtk_container_set_border_width(GTK_CONTAINER(resolv_vb), DLG_OUTER_MARGIN); - gtk_container_add(GTK_CONTAINER(resolv_fr), resolv_vb); - -@@ -5206,14 +5202,14 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_resolv_cb), - gbl_resolv_flags.mac_name); - gtk_widget_set_tooltip_text(m_resolv_cb, "Perform MAC layer name resolution while capturing."); -- gtk_box_pack_start(GTK_BOX (resolv_vb), m_resolv_cb, TRUE, TRUE, 0); -+ gtk_box_pack_start(GTK_BOX (resolv_vb), m_resolv_cb, FALSE, TRUE, 0); - - n_resolv_cb = gtk_check_button_new_with_mnemonic( - "Resolve _network-layer names"); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(n_resolv_cb), - gbl_resolv_flags.network_name); - gtk_widget_set_tooltip_text(n_resolv_cb, "Perform network layer name resolution while capturing."); -- gtk_box_pack_start(GTK_BOX (resolv_vb), n_resolv_cb, TRUE, TRUE, 0); -+ gtk_box_pack_start(GTK_BOX (resolv_vb), n_resolv_cb, FALSE, TRUE, 0); - - t_resolv_cb = gtk_check_button_new_with_mnemonic( - "Resolve _transport-layer name"); -@@ -5221,7 +5217,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - gbl_resolv_flags.transport_name); - gtk_widget_set_tooltip_text(t_resolv_cb, - "Perform transport layer name resolution while capturing."); -- gtk_box_pack_start(GTK_BOX (resolv_vb), t_resolv_cb, TRUE, TRUE, 0); -+ gtk_box_pack_start(GTK_BOX (resolv_vb), t_resolv_cb, FALSE, TRUE, 0); - - e_resolv_cb = gtk_check_button_new_with_mnemonic( - "Use _external network name resolver"); -@@ -5229,7 +5225,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) - gbl_resolv_flags.use_external_net_name_resolver); - gtk_widget_set_tooltip_text(e_resolv_cb, - "Use the (system's) configured name resolver (e.g., DNS) to resolve network names."); -- gtk_box_pack_start(GTK_BOX (resolv_vb), e_resolv_cb, TRUE, TRUE, 0); -+ gtk_box_pack_start(GTK_BOX (resolv_vb), e_resolv_cb, FALSE, TRUE, 0); - - /* Button row: "Start", "Cancel" and "Help" buttons */ - bbox = dlg_button_row_new(WIRESHARK_STOCK_CAPTURE_START, GTK_STOCK_CLOSE, GTK_STOCK_HELP, NULL); diff --git a/wireshark-0026-amqp-1.0.patch b/wireshark-0026-amqp-1.0.patch deleted file mode 100644 index 2b369a2..0000000 --- a/wireshark-0026-amqp-1.0.patch +++ /dev/null @@ -1,3485 +0,0 @@ -diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c -index fbb170b..cf7fc9c 100644 ---- a/epan/dissectors/packet-amqp.c -+++ b/epan/dissectors/packet-amqp.c -@@ -4,6 +4,7 @@ - * - * Author: Martin Sustrik (AMQP 0-9) - * Author: Steve Huston (extended for AMQP 0-10) -+ * Author: Pavel Moravec (extended for AMQP 1.0) - * - * Copyright (c) 1996-2007 iMatix Corporation - * -@@ -41,7 +42,7 @@ - #include - #include - #include --#include -+#include - #include "packet-tcp.h" - - /* Generic data */ -@@ -56,7 +57,7 @@ static int amqp_port = 5672; - } - - /* -- * This dissector handles AMQP 0-9 and 0-10. The conversation structure -+ * This dissector handles AMQP 0-9, 0-10 and 1.0. The conversation structure - * contains the version being run - it's only really reliably detected at - * protocol init. If this dissector starts in the middle of a conversation - * it will try to figure it out, but conversation start is the best. -@@ -66,10 +67,13 @@ static int amqp_port = 5672; - #define AMQP_V0_9 2 - /* #define AMQP_V0_91 3 */ - #define AMQP_V0_10 4 -+#define AMQP_V1_0 5 - typedef struct { - guint8 version; - } amqp_conv; - -+#define MAX_BUFFER 256 -+ - /* 0-9 defines */ - - #define AMQP_0_9_FRAME_TYPE_METHOD 1 -@@ -192,6 +196,65 @@ typedef struct { - - #define AMQP_0_9_METHOD_TUNNEL_REQUEST 10 - -+/* AMQP 1.0 values */ -+ -+#define AMQP_1_0_AMQP_FRAME 0 -+#define AMQP_1_0_SASL_FRAME 1 -+#define AMQP_1_0_TLS_FRAME 2 -+ -+#define AMQP_1_0_AMQP_OPEN 0x10 -+#define AMQP_1_0_AMQP_BEGIN 0x11 -+#define AMQP_1_0_AMQP_ATTACH 0x12 -+#define AMQP_1_0_AMQP_FLOW 0x13 -+#define AMQP_1_0_AMQP_TRANSFER 0x14 -+#define AMQP_1_0_AMQP_DISPOSITION 0x15 -+#define AMQP_1_0_AMQP_DETACH 0x16 -+#define AMQP_1_0_AMQP_END 0x17 -+#define AMQP_1_0_AMQP_CLOSE 0x18 -+ -+#define AMQP_1_0_SASL_MECHANISMS 0x40 -+#define AMQP_1_0_SASL_INIT 0x41 -+#define AMQP_1_0_SASL_CHALLENGE 0x42 -+#define AMQP_1_0_SASL_RESPONSE 0x43 -+#define AMQP_1_0_SASL_OUTCOME 0x44 -+ -+#define AMQP_1_0_AMQP_TYPE_ERROR 0x1d -+#define AMQP_1_0_AMQP_TYPE_HEADER 0x70 -+#define AMQP_1_0_AMQP_TYPE_DELIVERY_ANNOTATIONS 0x71 -+#define AMQP_1_0_AMQP_TYPE_MESSAGE_ANNOTATIONS 0x72 -+#define AMQP_1_0_AMQP_TYPE_PROPERTIES 0x73 -+#define AMQP_1_0_AMQP_TYPE_APPLICATION_PROPERTIES 0x74 -+#define AMQP_1_0_AMQP_TYPE_DATA 0x75 -+#define AMQP_1_0_AMQP_TYPE_AMQP_SEQUENCE 0x76 -+#define AMQP_1_0_AMQP_TYPE_AMQP_VALUE 0x77 -+#define AMQP_1_0_AMQP_TYPE_FOOTER 0x78 -+#define AMQP_1_0_AMQP_TYPE_RECEIVED 0x23 -+#define AMQP_1_0_AMQP_TYPE_ACCEPTED 0x24 -+#define AMQP_1_0_AMQP_TYPE_REJECTED 0x25 -+#define AMQP_1_0_AMQP_TYPE_RELEASED 0x26 -+#define AMQP_1_0_AMQP_TYPE_MODIFIED 0x27 -+#define AMQP_1_0_AMQP_TYPE_SOURCE 0x28 -+#define AMQP_1_0_AMQP_TYPE_TARGET 0x29 -+#define AMQP_1_0_AMQP_TYPE_DELETE_ON_CLOSE 0x2b -+#define AMQP_1_0_AMQP_TYPE_DELETE_ON_NO_LINKS 0x2c -+#define AMQP_1_0_AMQP_TYPE_DELETE_ON_NO_MESSAGE 0x2d -+#define AMQP_1_0_AMQP_TYPE_DELETE_ON_NO_LINKS_OR_MESSAGE 0x2e -+#define AMQP_1_0_AMQP_TYPE_COORDINATOR 0x30 -+#define AMQP_1_0_AMQP_TYPE_DECLARE 0x31 -+#define AMQP_1_0_AMQP_TYPE_DISCHARGE 0x32 -+#define AMQP_1_0_AMQP_TYPE_DECLARED 0x33 -+#define AMQP_1_0_AMQP_TYPE_TRANSACTIONAL_STATE 0x34 -+ -+#define AMQP_1_0_TYPE_DESCRIPTOR_CONSTRUCTOR 0x00 -+ -+#define AMQP_1_0_TYPE_LIST0 0x45 -+#define AMQP_1_0_TYPE_LIST8 0xc0 -+#define AMQP_1_0_TYPE_LIST32 0xd0 -+#define AMQP_1_0_TYPE_MAP8 0xc1 -+#define AMQP_1_0_TYPE_MAP32 0xd1 -+#define AMQP_1_0_TYPE_ARRAY8 0xe0 -+#define AMQP_1_0_TYPE_ARRAY32 0xf0 -+ - /* AMQP 0-10 values */ - - #define AMQP_0_10_FRAME_CONTROL 0 -@@ -330,6 +393,40 @@ static void - check_amqp_version(tvbuff_t *tvb, amqp_conv *conn); - - static guint -+get_amqp_1_0_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset); -+ -+static guint -+dissect_amqp_1_0_list(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ proto_item *item, -+ int hf_amqp_type, -+ int hf_amqp_subtype_count, -+ const int **hf_amqp_subtypes, -+ const char *name); -+ -+static guint -+dissect_amqp_1_0_map(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ proto_item *item, -+ int hf_amqp_type, -+ const char *name); -+ -+static guint -+dissect_amqp_1_0_array(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ proto_item *item, -+ int hf_amqp_type, -+ int hf_amqp_subtype_count, -+ const int **hf_amqp_subtypes, -+ const char *name); -+ -+static guint - get_amqp_0_10_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset); - - static guint -@@ -470,6 +567,25 @@ dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static void - dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - -+static guint32 -+dissect_amqp_1_0_AMQP_frame(tvbuff_t *tvb, -+ guint offset, -+ guint16 bound, -+ proto_item *amqp_tree, -+ packet_info *pinfo, -+ const gchar **method_name); -+ -+static guint32 -+dissect_amqp_1_0_SASL_frame(tvbuff_t *tvb, -+ guint offset, -+ guint16 bound, -+ proto_item *amqp_tree, -+ packet_info *pinfo, -+ const gchar **method_name); -+ -+static void -+dissect_amqp_1_0_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -+ - static int - dissect_amqp_0_9_method_connection_start(tvbuff_t *tvb, packet_info *pinfo, - int offset, proto_tree *args_tree); -@@ -851,6 +967,144 @@ struct amqp_typeinfo { - type_formatter formatter; - guint known_size; - }; -+ -+/* AMQP 1-0 type decoding information */ -+ -+/* struct for field interpreting format code (i.e. 0x70 for msg.header) to relevant hf_* variable -+ * (here hf_amqp_1_0_messageHeader). If the type is list, next 2 struct items specify how to -+ * interpret list items (in terms of hf_* variable) -+ */ -+struct amqp_defined_types_t { -+ const int format_code; -+ int *hf_amqp_type; -+ int hf_amqp_subtype_count; -+ const int **hf_amqp_subtypes; -+}; -+ -+/* functions for decoding 1.0 type and/or value */ -+ -+static gboolean decode_fixed_type(tvbuff_t *tvb, -+ guint8 code, -+ int offset, -+ int bound, -+ guint8 *type_width_size, -+ guint *length_size, -+ const char **type_name, -+ const char **value); -+ -+static proto_item* -+add_1_0_proto_item(proto_item *item, -+ tvbuff_t *tvb, -+ int offset, -+ int length, -+ int hf_amqp_type, -+ const char *no_format_value); -+ -+static void -+get_amqp_1_0_value_formatter(tvbuff_t *tvb, -+ packet_info *pinfo, -+ guint8 code, -+ int offset, -+ int bound, -+ int hf_amqp_type, -+ const char *name, -+ int hf_amqp_subtype_count, -+ const int **hf_amqp_subtypes, -+ guint *length_size, -+ proto_item *item); -+ -+static guint -+get_amqp_1_0_type_formatter(tvbuff_t *tvb, -+ int offset, -+ int bound, -+ int *hf_amqp_type, -+ const char **name, -+ int *hf_amqp_subtype_count, -+ const int ***hf_amqp_subtypes, -+ guint *length_size); -+ -+static void -+get_amqp_1_0_type_value_formatter(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ int hf_amqp_type, -+ const char *name, -+ guint *length_size, -+ proto_item *item); -+ -+/* functions for decoding particular primitive types */ -+ -+static int -+format_amqp_1_0_null(tvbuff_t *tvb _U_, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value _U_); -+ -+static int -+format_amqp_1_0_boolean_true(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_boolean_false(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_boolean(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_uint(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length, -+ const char **value); -+ -+static int -+format_amqp_1_0_int(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length, -+ const char **value); -+ -+static int -+format_amqp_1_0_float(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_double(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_char(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_timestamp(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_uuid(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value); -+ -+static int -+format_amqp_1_0_bin(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length, -+ const char **value); -+ -+static int -+format_amqp_1_0_str(tvbuff_t *tvb, -+ guint offset, guint bound, guint length, -+ const char **value); -+ -+static int -+format_amqp_1_0_symbol(tvbuff_t *tvb, -+ guint offset, guint bound, guint length, -+ const char **value); -+ - static gboolean - get_amqp_0_10_type_formatter(guint8 code, - const char **name, -@@ -899,6 +1153,533 @@ format_amqp_0_10_sequence_set(tvbuff_t *tvb, guint offset, guint length, - /* Various handles */ - - static int proto_amqp = -1; -+static const char* element_suffix [] = {"", "s"}; /* to distinguish singular/plural in "list of 1 item" vs. "list of 2 items" */ -+ -+/* 1.0 handles */ -+ -+static int hf_amqp_1_0_size = -1; -+static int hf_amqp_1_0_doff = -1; -+static int hf_amqp_1_0_type = -1; -+static int hf_amqp_1_0_containerId = -1; -+static int hf_amqp_1_0_hostname = -1; -+static int hf_amqp_1_0_maxFrameSize = -1; -+static int hf_amqp_1_0_channelMax = -1; -+static int hf_amqp_1_0_idleTimeOut = -1; -+static int hf_amqp_1_0_outgoingLocales = -1; -+static int hf_amqp_1_0_incomingLocales = -1; -+static int hf_amqp_1_0_offeredCapabilities = -1; -+static int hf_amqp_1_0_desiredCapabilities = -1; -+static int hf_amqp_1_0_properties = -1; -+static int hf_amqp_1_0_remoteChannel = -1; -+static int hf_amqp_1_0_nextOutgoingId = -1; -+static int hf_amqp_1_0_incomingWindow = -1; -+static int hf_amqp_1_0_outgoingWindow = -1; -+static int hf_amqp_1_0_handleMax = -1; -+static int hf_amqp_1_0_name = -1; -+static int hf_amqp_1_0_handle = -1; -+static int hf_amqp_1_0_role = -1; -+static int hf_amqp_1_0_sndSettleMode = -1; -+static int hf_amqp_1_0_rcvSettleMode = -1; -+static int hf_amqp_1_0_source = -1; -+static int hf_amqp_1_0_target = -1; -+static int hf_amqp_1_0_deleteOnClose = -1; -+static int hf_amqp_1_0_deleteOnNoLinks = -1; -+static int hf_amqp_1_0_deleteOnNoMessages = -1; -+static int hf_amqp_1_0_deleteOnNoLinksOrMessages = -1; -+static int hf_amqp_1_0_coordinator = -1; -+static int hf_amqp_1_0_declare = -1; -+static int hf_amqp_1_0_globalId = -1; -+static int hf_amqp_1_0_discharge = -1; -+static int hf_amqp_1_0_txnId = -1; -+static int hf_amqp_1_0_fail = -1; -+static int hf_amqp_1_0_declared = -1; -+static int hf_amqp_1_0_transactionalState = -1; -+static int hf_amqp_1_0_outcome = -1; -+static int hf_amqp_1_0_unsettled = -1; -+static int hf_amqp_1_0_incompleteUnsettled = -1; -+static int hf_amqp_1_0_initialDeliveryCount = -1; -+static int hf_amqp_1_0_maxMessageSize = -1; -+static int hf_amqp_1_0_nextIncomingId = -1; -+static int hf_amqp_1_0_deliveryCount = -1; -+static int hf_amqp_1_0_sectionNumber = -1; -+static int hf_amqp_1_0_sectionOffset = -1; -+static int hf_amqp_1_0_deliveryFailed = -1; -+static int hf_amqp_1_0_undeliverableHere = -1; -+static int hf_amqp_1_0_linkCredit = -1; -+static int hf_amqp_1_0_available = -1; -+static int hf_amqp_1_0_drain = -1; -+static int hf_amqp_1_0_echo = -1; -+static int hf_amqp_1_0_deliveryId = -1; -+static int hf_amqp_1_0_deliveryTag = -1; -+static int hf_amqp_1_0_messageFormat = -1; -+static int hf_amqp_1_0_settled = -1; -+static int hf_amqp_1_0_more = -1; -+static int hf_amqp_1_0_state = -1; -+static int hf_amqp_1_0_resume = -1; -+static int hf_amqp_1_0_aborted = -1; -+static int hf_amqp_1_0_batchable = -1; -+static int hf_amqp_1_0_first = -1; -+static int hf_amqp_1_0_last = -1; -+static int hf_amqp_1_0_closed = -1; -+static int hf_amqp_1_0_amqp_performative = -1; -+static int hf_amqp_1_0_error = -1; -+static int hf_amqp_1_0_messageHeader = -1; -+static int hf_amqp_1_0_deliveryAnnotations = -1; -+static int hf_amqp_1_0_messageAnnotations = -1; -+static int hf_amqp_1_0_messageProperties = -1; -+static int hf_amqp_1_0_applicationProperties = -1; -+static int hf_amqp_1_0_data = -1; -+static int hf_amqp_1_0_amqp_sequence = -1; -+static int hf_amqp_1_0_amqp_value = -1; -+static int hf_amqp_1_0_footer = -1; -+static int hf_amqp_1_0_received = -1; -+static int hf_amqp_1_0_accepted = -1; -+static int hf_amqp_1_0_rejected = -1; -+static int hf_amqp_1_0_released = -1; -+static int hf_amqp_1_0_modified = -1; -+static int hf_amqp_1_0_condition = -1; -+static int hf_amqp_1_0_description = -1; -+static int hf_amqp_1_0_info = -1; -+static int hf_amqp_1_0_address = -1; -+static int hf_amqp_1_0_durable = -1; -+static int hf_amqp_1_0_terminusDurable = -1; -+static int hf_amqp_1_0_priority = -1; -+static int hf_amqp_1_0_ttl = -1; -+static int hf_amqp_1_0_firstAcquirer = -1; -+static int hf_amqp_1_0_expiryPolicy = -1; -+static int hf_amqp_1_0_timeout = -1; -+static int hf_amqp_1_0_dynamic = -1; -+static int hf_amqp_1_0_dynamicNodeProperties = -1; -+static int hf_amqp_1_0_distributionMode = -1; -+static int hf_amqp_1_0_filter = -1; -+static int hf_amqp_1_0_defaultOutcome = -1; -+static int hf_amqp_1_0_outcomes = -1; -+static int hf_amqp_1_0_capabilities = -1; -+static int hf_amqp_1_0_messageId = -1; -+static int hf_amqp_1_0_userId = -1; -+static int hf_amqp_1_0_to = -1; -+static int hf_amqp_1_0_subject = -1; -+static int hf_amqp_1_0_replyTo = -1; -+static int hf_amqp_1_0_correlationId = -1; -+static int hf_amqp_1_0_contentType = -1; -+static int hf_amqp_1_0_contentEncoding = -1; -+static int hf_amqp_1_0_absoluteExpiryTime = -1; -+static int hf_amqp_1_0_creationTime = -1; -+static int hf_amqp_1_0_groupId = -1; -+static int hf_amqp_1_0_groupSequence = -1; -+static int hf_amqp_1_0_replyToGroupId = -1; -+static int hf_amqp_1_0_sasl_method = -1; -+static int hf_amqp_1_0_mechanisms = -1; -+static int hf_amqp_1_0_mechanism = -1; -+static int hf_amqp_1_0_initResponse = -1; -+static int hf_amqp_1_0_saslChallenge = -1; -+static int hf_amqp_1_0_saslResponse = -1; -+static int hf_amqp_1_0_saslCode = -1; -+static int hf_amqp_1_0_saslAdditionalData = -1; -+static int hf_amqp_1_0_list = -1; -+static int hf_amqp_1_0_map = -1; -+static int hf_amqp_1_0_array = -1; -+/* sub-hf_* variables for variant sub-types */ -+static int hf_amqp_1_0_hostname_str = -1; -+static int hf_amqp_1_0_maxFrameSize_1 = -1; -+static int hf_amqp_1_0_maxFrameSize_4 = -1; -+static int hf_amqp_1_0_incomingWindow_1 = -1; -+static int hf_amqp_1_0_incomingWindow_4 = -1; -+static int hf_amqp_1_0_outgoingWindow_1 = -1; -+static int hf_amqp_1_0_outgoingWindow_4 = -1; -+static int hf_amqp_1_0_linkCredit_1 = -1; -+static int hf_amqp_1_0_linkCredit_4 = -1; -+static int hf_amqp_1_0_available_1 = -1; -+static int hf_amqp_1_0_available_4 = -1; -+static int hf_amqp_1_0_deliveryCount_1 = -1; -+static int hf_amqp_1_0_deliveryCount_4 = -1; -+static int hf_amqp_1_0_sectionNumber_1 = -1; -+static int hf_amqp_1_0_sectionNumber_4 = -1; -+static int hf_amqp_1_0_idleTimeOut_1 = -1; -+static int hf_amqp_1_0_idleTimeOut_4 = -1; -+static int hf_amqp_1_0_outgoingLocales_sym = -1; -+static int hf_amqp_1_0_incomingLocales_sym = -1; -+static int hf_amqp_1_0_offeredCapabilities_sym = -1; -+static int hf_amqp_1_0_desiredCapabilities_sym = -1; -+static int hf_amqp_1_0_nextIncomingId_1 = -1; -+static int hf_amqp_1_0_nextIncomingId_4 = -1; -+static int hf_amqp_1_0_sectionOffset_1 = -1; -+static int hf_amqp_1_0_sectionOffset_8 = -1; -+static int hf_amqp_1_0_maxMessageSize_1 = -1; -+static int hf_amqp_1_0_maxMessageSize_8 = -1; -+static int hf_amqp_1_0_nextOutgoingId_1 = -1; -+static int hf_amqp_1_0_nextOutgoingId_4 = -1; -+static int hf_amqp_1_0_deliveryId_1 = -1; -+static int hf_amqp_1_0_deliveryId_4 = -1; -+static int hf_amqp_1_0_deliveryTag_bin = -1; -+static int hf_amqp_1_0_messageFormat_1 = -1; -+static int hf_amqp_1_0_messageFormat_4 = -1; -+static int hf_amqp_1_0_first_1 = -1; -+static int hf_amqp_1_0_first_4 = -1; -+static int hf_amqp_1_0_last_1 = -1; -+static int hf_amqp_1_0_last_4 = -1; -+static int hf_amqp_1_0_remoteChannel_2 = -1; -+static int hf_amqp_1_0_handleMax_1 = -1; -+static int hf_amqp_1_0_handleMax_4 = -1; -+static int hf_amqp_1_0_handle_1 = -1; -+static int hf_amqp_1_0_handle_4 = -1; -+static int hf_amqp_1_0_sndSettleMode_1 = -1; -+static int hf_amqp_1_0_rcvSettleMode_1 = -1; -+static int hf_amqp_1_0_initialDeliveryCount_1 = -1; -+static int hf_amqp_1_0_initialDeliveryCount_4 = -1; -+static int hf_amqp_1_0_description_str = -1; -+static int hf_amqp_1_0_address_str = -1; -+static int hf_amqp_1_0_terminusDurable_1 = -1; -+static int hf_amqp_1_0_terminusDurable_4 = -1; -+static int hf_amqp_1_0_priority_1 = -1; -+static int hf_amqp_1_0_ttl_1 = -1; -+static int hf_amqp_1_0_ttl_4 = -1; -+static int hf_amqp_1_0_expiryPolicy_sym = -1; -+static int hf_amqp_1_0_timeout_1 = -1; -+static int hf_amqp_1_0_timeout_4 = -1; -+static int hf_amqp_1_0_distributionMode_sym = -1; -+static int hf_amqp_1_0_outcomes_sym = -1; -+static int hf_amqp_1_0_capabilities_sym = -1; -+static int hf_amqp_1_0_messageId_1 = -1; -+static int hf_amqp_1_0_messageId_str = -1; -+static int hf_amqp_1_0_messageId_bin = -1; -+static int hf_amqp_1_0_messageId_uuid = -1; -+static int hf_amqp_1_0_messageId_8 = -1; -+static int hf_amqp_1_0_correlationId_1 = -1; -+static int hf_amqp_1_0_correlationId_str = -1; -+static int hf_amqp_1_0_correlationId_bin = -1; -+static int hf_amqp_1_0_correlationId_uuid = -1; -+static int hf_amqp_1_0_correlationId_8 = -1; -+static int hf_amqp_1_0_userId_bin = -1; -+static int hf_amqp_1_0_to_str = -1; -+static int hf_amqp_1_0_subject_str = -1; -+static int hf_amqp_1_0_replyTo_str = -1; -+static int hf_amqp_1_0_contentType_sym = -1; -+static int hf_amqp_1_0_contentEncoding_sym = -1; -+static int hf_amqp_1_0_absoluteExpiryTime_timestamp = -1; -+static int hf_amqp_1_0_creationTime_timestamp = -1; -+static int hf_amqp_1_0_groupId_str = -1; -+static int hf_amqp_1_0_groupSequence_1 = -1; -+static int hf_amqp_1_0_groupSequence_4 = -1; -+static int hf_amqp_1_0_replyToGroupId_str = -1; -+static int hf_amqp_1_0_mechanisms_sym = -1; -+static int hf_amqp_1_0_initResponse_bin = -1; -+static int hf_amqp_1_0_saslAdditionalData_bin = -1; -+ -+/* Many AMQP variables can have value in either 0,1,2,4,8 or 16 bytes, depending on particular type. -+ * To distinguish it among hf_amqp_1_0_* variables, table below "translates" original hf_amqp_1_0_* -+ * variable to the proper one based on format code subcategory -+ */ -+ -+const int* hf_amqp_1_0_hostname_[] = { &hf_amqp_1_0_hostname, &hf_amqp_1_0_hostname_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_maxFrameSize_[] = { &hf_amqp_1_0_maxFrameSize, &hf_amqp_1_0_maxFrameSize_1, NULL, &hf_amqp_1_0_maxFrameSize_4, NULL, NULL }; -+const int* hf_amqp_1_0_incomingWindow_[] = { &hf_amqp_1_0_incomingWindow, &hf_amqp_1_0_incomingWindow_1, NULL, &hf_amqp_1_0_incomingWindow_4, NULL, NULL }; -+const int* hf_amqp_1_0_outgoingWindow_[] = { &hf_amqp_1_0_outgoingWindow, &hf_amqp_1_0_outgoingWindow_1, NULL, &hf_amqp_1_0_outgoingWindow_4, NULL, NULL }; -+const int* hf_amqp_1_0_linkCredit_[] = { &hf_amqp_1_0_linkCredit, &hf_amqp_1_0_linkCredit_1, NULL, &hf_amqp_1_0_linkCredit_4, NULL, NULL }; -+const int* hf_amqp_1_0_available_[] = { &hf_amqp_1_0_available, &hf_amqp_1_0_available_1, NULL, &hf_amqp_1_0_available_4, NULL, NULL }; -+const int* hf_amqp_1_0_deliveryCount_[] = { &hf_amqp_1_0_deliveryCount, &hf_amqp_1_0_deliveryCount_1, NULL, &hf_amqp_1_0_deliveryCount_4, NULL, NULL }; -+const int* hf_amqp_1_0_sectionNumber_[] = { &hf_amqp_1_0_sectionNumber, &hf_amqp_1_0_sectionNumber_1, NULL, &hf_amqp_1_0_sectionNumber_4, NULL, NULL }; -+const int* hf_amqp_1_0_idleTimeOut_[] = { &hf_amqp_1_0_idleTimeOut, &hf_amqp_1_0_idleTimeOut_1, NULL, &hf_amqp_1_0_idleTimeOut_4, NULL, NULL }; -+const int* hf_amqp_1_0_outgoingLocales_[] = { &hf_amqp_1_0_outgoingLocales, &hf_amqp_1_0_outgoingLocales_sym, NULL, &hf_amqp_1_0_outgoingLocales_sym, NULL, NULL }; -+const int* hf_amqp_1_0_incomingLocales_[] = { &hf_amqp_1_0_incomingLocales, &hf_amqp_1_0_incomingLocales_sym, NULL, &hf_amqp_1_0_incomingLocales_sym, NULL, NULL }; -+const int* hf_amqp_1_0_offeredCapabilities_[] = { &hf_amqp_1_0_offeredCapabilities, &hf_amqp_1_0_offeredCapabilities_sym, NULL, &hf_amqp_1_0_offeredCapabilities_sym, NULL, NULL }; -+const int* hf_amqp_1_0_desiredCapabilities_[] = { &hf_amqp_1_0_desiredCapabilities, &hf_amqp_1_0_desiredCapabilities_sym, NULL, &hf_amqp_1_0_desiredCapabilities_sym, NULL, NULL }; -+const int* hf_amqp_1_0_nextIncomingId_[] = { &hf_amqp_1_0_nextIncomingId, &hf_amqp_1_0_nextIncomingId_1, NULL, &hf_amqp_1_0_nextIncomingId_4, NULL, NULL }; -+const int* hf_amqp_1_0_sectionOffset_[] = { &hf_amqp_1_0_sectionOffset, &hf_amqp_1_0_sectionOffset_1, NULL, NULL, &hf_amqp_1_0_sectionOffset_8, NULL }; -+const int* hf_amqp_1_0_maxMessageSize_[] = { &hf_amqp_1_0_maxMessageSize, &hf_amqp_1_0_maxMessageSize_1, NULL, NULL, &hf_amqp_1_0_maxMessageSize_8, NULL }; -+const int* hf_amqp_1_0_nextOutgoingId_[] = { &hf_amqp_1_0_nextOutgoingId, &hf_amqp_1_0_nextOutgoingId_1, NULL, &hf_amqp_1_0_nextOutgoingId_4, NULL, NULL }; -+const int* hf_amqp_1_0_deliveryId_[] = { &hf_amqp_1_0_deliveryId, &hf_amqp_1_0_deliveryId_1, NULL, &hf_amqp_1_0_deliveryId_4, NULL, NULL }; -+const int* hf_amqp_1_0_deliveryTag_[] = { &hf_amqp_1_0_deliveryTag, &hf_amqp_1_0_deliveryTag_bin, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_messageFormat_[] = { &hf_amqp_1_0_messageFormat, &hf_amqp_1_0_messageFormat_1, NULL, &hf_amqp_1_0_messageFormat_4, NULL, NULL }; -+const int* hf_amqp_1_0_first_[] = { &hf_amqp_1_0_first, &hf_amqp_1_0_first_1, NULL, &hf_amqp_1_0_first_4, NULL, NULL }; -+const int* hf_amqp_1_0_last_[] = { &hf_amqp_1_0_last, &hf_amqp_1_0_last_1, NULL, &hf_amqp_1_0_last_4, NULL, NULL }; -+const int* hf_amqp_1_0_remoteChannel_[] = { &hf_amqp_1_0_remoteChannel, NULL, &hf_amqp_1_0_remoteChannel_2, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_handleMax_[] = { &hf_amqp_1_0_handleMax, &hf_amqp_1_0_handleMax_1, NULL, &hf_amqp_1_0_handleMax_4, NULL, NULL }; -+const int* hf_amqp_1_0_handle_[] = { &hf_amqp_1_0_handle, &hf_amqp_1_0_handle_1, NULL, &hf_amqp_1_0_handle_4, NULL, NULL }; -+const int* hf_amqp_1_0_sndSettleMode_[] = { &hf_amqp_1_0_sndSettleMode, &hf_amqp_1_0_sndSettleMode_1, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_rcvSettleMode_[] = { &hf_amqp_1_0_rcvSettleMode, &hf_amqp_1_0_rcvSettleMode_1, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_initialDeliveryCount_[] = { &hf_amqp_1_0_initialDeliveryCount, &hf_amqp_1_0_initialDeliveryCount_1, NULL, &hf_amqp_1_0_initialDeliveryCount_4, NULL, NULL }; -+const int* hf_amqp_1_0_description_[] = { &hf_amqp_1_0_description, &hf_amqp_1_0_description_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_address_[] = { &hf_amqp_1_0_address, &hf_amqp_1_0_address_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_terminusDurable_[] = { &hf_amqp_1_0_terminusDurable, &hf_amqp_1_0_terminusDurable_1, NULL, &hf_amqp_1_0_terminusDurable_4, NULL, NULL }; -+const int* hf_amqp_1_0_priority_[] = { &hf_amqp_1_0_priority, &hf_amqp_1_0_priority_1, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_ttl_[] = { &hf_amqp_1_0_ttl, &hf_amqp_1_0_ttl_1, NULL, &hf_amqp_1_0_ttl_4, NULL, NULL }; -+const int* hf_amqp_1_0_expiryPolicy_[] = { &hf_amqp_1_0_expiryPolicy, &hf_amqp_1_0_expiryPolicy_sym, NULL, &hf_amqp_1_0_expiryPolicy_sym, NULL, NULL }; -+const int* hf_amqp_1_0_timeout_[] = { &hf_amqp_1_0_timeout, &hf_amqp_1_0_timeout_1, NULL, &hf_amqp_1_0_timeout_4, NULL, NULL }; -+const int* hf_amqp_1_0_distributionMode_[] = { &hf_amqp_1_0_distributionMode, &hf_amqp_1_0_distributionMode_sym, NULL, &hf_amqp_1_0_distributionMode_sym, NULL, NULL }; -+const int* hf_amqp_1_0_outcomes_[] = { &hf_amqp_1_0_outcomes, &hf_amqp_1_0_outcomes_sym, NULL, &hf_amqp_1_0_outcomes_sym, NULL, NULL }; -+const int* hf_amqp_1_0_capabilities_[] = { &hf_amqp_1_0_capabilities, &hf_amqp_1_0_capabilities_sym, NULL, &hf_amqp_1_0_capabilities_sym, NULL, NULL }; -+const int* hf_amqp_1_0_messageId_[] = { &hf_amqp_1_0_messageId, &hf_amqp_1_0_messageId_1, &hf_amqp_1_0_messageId_str, &hf_amqp_1_0_messageId_bin, &hf_amqp_1_0_messageId_8, &hf_amqp_1_0_messageId_uuid }; -+const int* hf_amqp_1_0_correlationId_[] = { &hf_amqp_1_0_correlationId, &hf_amqp_1_0_correlationId_1, &hf_amqp_1_0_correlationId_str, &hf_amqp_1_0_correlationId_bin, &hf_amqp_1_0_correlationId_8, &hf_amqp_1_0_correlationId_uuid }; -+const int* hf_amqp_1_0_userId_[] = { &hf_amqp_1_0_userId, &hf_amqp_1_0_userId_bin, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_to_[] = { &hf_amqp_1_0_to, &hf_amqp_1_0_to_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_subject_[] = { &hf_amqp_1_0_subject, &hf_amqp_1_0_subject_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_replyTo_[] = { &hf_amqp_1_0_replyTo, &hf_amqp_1_0_replyTo_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_contentType_[] = { &hf_amqp_1_0_contentType, &hf_amqp_1_0_contentType_sym, NULL, &hf_amqp_1_0_contentType_sym, NULL, NULL }; -+const int* hf_amqp_1_0_contentEncoding_[] = { &hf_amqp_1_0_contentEncoding, &hf_amqp_1_0_contentEncoding_sym, NULL, &hf_amqp_1_0_contentEncoding_sym, NULL, NULL }; -+const int* hf_amqp_1_0_absoluteExpiryTime_[] = { &hf_amqp_1_0_absoluteExpiryTime, NULL, NULL, NULL, &hf_amqp_1_0_absoluteExpiryTime_timestamp, NULL }; -+const int* hf_amqp_1_0_creationTime_[] = { &hf_amqp_1_0_creationTime, NULL, NULL, NULL, &hf_amqp_1_0_creationTime_timestamp, NULL }; -+const int* hf_amqp_1_0_groupId_[] = { &hf_amqp_1_0_groupId, &hf_amqp_1_0_groupId_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_groupSequence_[] = { &hf_amqp_1_0_groupSequence, &hf_amqp_1_0_groupSequence_1, NULL, &hf_amqp_1_0_groupSequence_4, NULL, NULL }; -+const int* hf_amqp_1_0_replyToGroupId_[] = { &hf_amqp_1_0_replyToGroupId, &hf_amqp_1_0_replyToGroupId_str, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_mechanisms_[] = { &hf_amqp_1_0_mechanisms, &hf_amqp_1_0_mechanisms_sym, NULL, &hf_amqp_1_0_mechanisms_sym, NULL, NULL }; -+const int* hf_amqp_1_0_initResponse_[] = { &hf_amqp_1_0_initResponse, &hf_amqp_1_0_initResponse_bin, NULL, NULL, NULL, NULL }; -+const int* hf_amqp_1_0_saslAdditionalData_[] = { &hf_amqp_1_0_saslAdditionalData, &hf_amqp_1_0_saslAdditionalData_bin, NULL, NULL, NULL, NULL }; -+ -+const int** subtypes_for_hf_amqp_1_0[] = { -+ NULL, /* hf_amqp_1_0_size */ -+ NULL, /* hf_amqp_1_0_doff */ -+ NULL, /* hf_amqp_1_0_type */ -+ NULL, /* hf_amqp_1_0_amqp_performative */ -+ NULL, /* hf_amqp_1_0_sasl_method */ -+ NULL, /* hf_amqp_1_0_list */ -+ NULL, /* hf_amqp_1_0_map */ -+ NULL, /* hf_amqp_1_0_array */ -+ NULL, /* hf_amqp_1_0_containerId - mandatory string */ -+ hf_amqp_1_0_hostname_, -+ hf_amqp_1_0_maxFrameSize_, -+ NULL, /* hf_amqp_1_0_channelMax_,*/ -+ hf_amqp_1_0_idleTimeOut_, -+ hf_amqp_1_0_outgoingLocales_, -+ hf_amqp_1_0_incomingLocales_, -+ hf_amqp_1_0_offeredCapabilities_, -+ hf_amqp_1_0_desiredCapabilities_, -+ NULL, /* hf_amqp_1_0_properties */ -+ hf_amqp_1_0_nextIncomingId_, -+ hf_amqp_1_0_deliveryCount_, -+ hf_amqp_1_0_sectionNumber_, -+ hf_amqp_1_0_sectionOffset_, -+ NULL, /* hf_amqp_1_0_deliveryFailed */ -+ NULL, /* hf_amqp_1_0_undeliverableHere */ -+ hf_amqp_1_0_linkCredit_, -+ hf_amqp_1_0_available_, -+ NULL, /* hf_amqp_1_0_drain */ -+ NULL, /* hf_amqp_1_0_echo */ -+ hf_amqp_1_0_deliveryId_, -+ hf_amqp_1_0_deliveryTag_, -+ hf_amqp_1_0_messageFormat_, -+ NULL, /* hf_amqp_1_0_settled */ -+ NULL, /* hf_amqp_1_0_more */ -+ NULL, /* hf_amqp_1_0_state */ -+ NULL, /* hf_amqp_1_0_resume */ -+ NULL, /* hf_amqp_1_0_aborted */ -+ NULL, /* hf_amqp_1_0_batchable */ -+ hf_amqp_1_0_first_, -+ hf_amqp_1_0_last_, -+ NULL, /* hf_amqp_1_0_closed */ -+ hf_amqp_1_0_remoteChannel_, -+ hf_amqp_1_0_nextOutgoingId_, -+ hf_amqp_1_0_incomingWindow_, -+ hf_amqp_1_0_outgoingWindow_, -+ hf_amqp_1_0_handleMax_, -+ NULL, /* hf_amqp_1_0_name */ -+ hf_amqp_1_0_handle_, -+ NULL, /* hf_amqp_1_0_role */ -+ hf_amqp_1_0_sndSettleMode_, -+ hf_amqp_1_0_rcvSettleMode_, -+ NULL, /* hf_amqp_1_0_source */ -+ NULL, /* hf_amqp_1_0_target */ -+ NULL, /* hf_amqp_1_0_deleteOnClose */ -+ NULL, /* hf_amqp_1_0_deleteOnNoLinks */ -+ NULL, /* hf_amqp_1_0_deleteOnNoMessages */ -+ NULL, /* hf_amqp_1_0_deleteOnNoLinksOrMessages */ -+ NULL, /* hf_amqp_1_0_coordinator */ -+ NULL, /* hf_amqp_1_0_declare */ -+ NULL, /* hf_amqp_1_0_globalId */ -+ NULL, /* hf_amqp_1_0_discharge */ -+ NULL, /* hf_amqp_1_0_txnId */ -+ NULL, /* hf_amqp_1_0_fail */ -+ NULL, /* hf_amqp_1_0_declared */ -+ NULL, /* hf_amqp_1_0_transactionalState */ -+ NULL, /* hf_amqp_1_0_outcome */ -+ NULL, /* hf_amqp_1_0_unsettled */ -+ NULL, /* hf_amqp_1_0_incompleteUnsettled */ -+ hf_amqp_1_0_initialDeliveryCount_, -+ hf_amqp_1_0_maxMessageSize_, -+ NULL, /* hf_amqp_1_0_error */ -+ NULL, /* hf_amqp_1_0_messageHeader */ -+ NULL, /* hf_amqp_1_0_messageProperties */ -+ NULL, /* hf_amqp_1_0_deliveryAnnotations */ -+ NULL, /* hf_amqp_1_0_messageAnnotations */ -+ NULL, /* hf_amqp_1_0_applicationProperties */ -+ NULL, /* hf_amqp_1_0_data */ -+ NULL, /* hf_amqp_1_0_amqp_sequence */ -+ NULL, /* hf_amqp_1_0_amqp_value */ -+ NULL, /* hf_amqp_1_0_footer */ -+ NULL, /* hf_amqp_1_0_received */ -+ NULL, /* hf_amqp_1_0_accepted */ -+ NULL, /* hf_amqp_1_0_rejected */ -+ NULL, /* hf_amqp_1_0_released */ -+ NULL, /* hf_amqp_1_0_modified */ -+ NULL, /* hf_amqp_1_0_condition */ -+ hf_amqp_1_0_description_, -+ NULL, /* hf_amqp_1_0_info */ -+ hf_amqp_1_0_address_, -+ NULL, /* hf_amqp_1_0_durable */ -+ hf_amqp_1_0_terminusDurable_, -+ hf_amqp_1_0_priority_, -+ hf_amqp_1_0_ttl_, -+ NULL, /* hf_amqp_1_0_firstAcquirer */ -+ hf_amqp_1_0_expiryPolicy_, -+ hf_amqp_1_0_timeout_, -+ NULL, /* hf_amqp_1_0_dynamic */ -+ NULL, /* hf_amqp_1_0_dynamicNodeProperties */ -+ hf_amqp_1_0_distributionMode_, -+ NULL, /* hf_amqp_1_0_filter */ -+ NULL, /* hf_amqp_1_0_defaultOutcome */ -+ hf_amqp_1_0_outcomes_, -+ hf_amqp_1_0_capabilities_, -+ hf_amqp_1_0_messageId_, -+ hf_amqp_1_0_userId_, -+ hf_amqp_1_0_to_, -+ hf_amqp_1_0_subject_, -+ hf_amqp_1_0_replyTo_, -+ hf_amqp_1_0_correlationId_, -+ hf_amqp_1_0_contentType_, -+ hf_amqp_1_0_contentEncoding_, -+ hf_amqp_1_0_absoluteExpiryTime_, -+ hf_amqp_1_0_creationTime_, -+ hf_amqp_1_0_groupId_, -+ hf_amqp_1_0_groupSequence_, -+ hf_amqp_1_0_replyToGroupId_, -+ hf_amqp_1_0_mechanisms_, -+ NULL, /* hf_amqp_1_0_mechanism */ -+ hf_amqp_1_0_initResponse_, -+ NULL, /* hf_amqp_1_0_saslChallenge */ -+ NULL, /* hf_amqp_1_0_saslResponse */ -+ NULL, /* hf_amqp_1_0_saslCode */ -+ hf_amqp_1_0_saslAdditionalData_ -+}; -+ -+/* fields with hf_* types for list items; -+ * i.e. sasl.init method has 3 arguments in a list (mechanism, init.response, hostname) -+ * so when dissecting sasl.init arguments list, identify the list items with -+ * corresponding hf_* variable */ -+const int* hf_amqp_1_0_sasl_mechanisms_items[] = { &hf_amqp_1_0_mechanisms }; -+const int* hf_amqp_1_0_sasl_init_items[] = { &hf_amqp_1_0_mechanism, -+ &hf_amqp_1_0_initResponse, -+ &hf_amqp_1_0_hostname }; -+const int* hf_amqp_1_0_sasl_challenge_items[] = { &hf_amqp_1_0_saslChallenge }; -+const int* hf_amqp_1_0_sasl_response_items[] = { &hf_amqp_1_0_saslResponse }; -+const int* hf_amqp_1_0_sasl_outcome_items[] = { &hf_amqp_1_0_saslCode, -+ &hf_amqp_1_0_saslAdditionalData }; -+const int* hf_amqp_1_0_amqp_open_items[] = { &hf_amqp_1_0_containerId, -+ &hf_amqp_1_0_hostname, -+ &hf_amqp_1_0_maxFrameSize, -+ &hf_amqp_1_0_channelMax, -+ &hf_amqp_1_0_idleTimeOut, -+ &hf_amqp_1_0_outgoingLocales, -+ &hf_amqp_1_0_incomingLocales, -+ &hf_amqp_1_0_offeredCapabilities, -+ &hf_amqp_1_0_desiredCapabilities, -+ &hf_amqp_1_0_properties }; -+const int* hf_amqp_1_0_amqp_begin_items[] = { &hf_amqp_1_0_remoteChannel, -+ &hf_amqp_1_0_nextOutgoingId, -+ &hf_amqp_1_0_incomingWindow, -+ &hf_amqp_1_0_outgoingWindow, -+ &hf_amqp_1_0_handleMax, -+ &hf_amqp_1_0_offeredCapabilities, -+ &hf_amqp_1_0_desiredCapabilities, -+ &hf_amqp_1_0_properties }; -+const int* hf_amqp_1_0_amqp_attach_items[] = { &hf_amqp_1_0_name, -+ &hf_amqp_1_0_handle, -+ &hf_amqp_1_0_role, -+ &hf_amqp_1_0_sndSettleMode, -+ &hf_amqp_1_0_rcvSettleMode, -+ &hf_amqp_1_0_source, -+ &hf_amqp_1_0_target, -+ &hf_amqp_1_0_unsettled, -+ &hf_amqp_1_0_incompleteUnsettled, -+ &hf_amqp_1_0_initialDeliveryCount, -+ &hf_amqp_1_0_maxMessageSize, -+ &hf_amqp_1_0_offeredCapabilities, -+ &hf_amqp_1_0_desiredCapabilities, -+ &hf_amqp_1_0_properties }; -+const int* hf_amqp_1_0_amqp_flow_items[] = { &hf_amqp_1_0_nextIncomingId, -+ &hf_amqp_1_0_incomingWindow, -+ &hf_amqp_1_0_nextOutgoingId, -+ &hf_amqp_1_0_outgoingWindow, -+ &hf_amqp_1_0_handle, -+ &hf_amqp_1_0_deliveryCount, -+ &hf_amqp_1_0_linkCredit, -+ &hf_amqp_1_0_available, -+ &hf_amqp_1_0_drain, -+ &hf_amqp_1_0_echo, -+ &hf_amqp_1_0_properties }; -+const int* hf_amqp_1_0_amqp_transfer_items[] = { &hf_amqp_1_0_handle, -+ &hf_amqp_1_0_deliveryId, -+ &hf_amqp_1_0_deliveryTag, -+ &hf_amqp_1_0_messageFormat, -+ &hf_amqp_1_0_settled, -+ &hf_amqp_1_0_more, -+ &hf_amqp_1_0_rcvSettleMode, -+ &hf_amqp_1_0_state, -+ &hf_amqp_1_0_resume, -+ &hf_amqp_1_0_aborted, -+ &hf_amqp_1_0_batchable }; -+const int* hf_amqp_1_0_amqp_disposition_items[] = { &hf_amqp_1_0_role, -+ &hf_amqp_1_0_first, -+ &hf_amqp_1_0_last, -+ &hf_amqp_1_0_settled, -+ &hf_amqp_1_0_state, -+ &hf_amqp_1_0_batchable }; -+const int* hf_amqp_1_0_amqp_detach_items[] = { &hf_amqp_1_0_handle, -+ &hf_amqp_1_0_closed, -+ &hf_amqp_1_0_error }; -+const int* hf_amqp_1_0_amqp_end_items[] = { &hf_amqp_1_0_error }; -+const int* hf_amqp_1_0_amqp_close_items[] = { &hf_amqp_1_0_error }; -+const int* hf_amqp_1_0_error_items[] = { &hf_amqp_1_0_condition, -+ &hf_amqp_1_0_description, -+ &hf_amqp_1_0_info }; -+const int* hf_amqp_1_0_messageHeader_items[] = { &hf_amqp_1_0_durable, -+ &hf_amqp_1_0_priority, -+ &hf_amqp_1_0_ttl, -+ &hf_amqp_1_0_firstAcquirer, -+ &hf_amqp_1_0_deliveryCount }; -+const int* hf_amqp_1_0_received_items[] = { &hf_amqp_1_0_sectionNumber, -+ &hf_amqp_1_0_sectionOffset }; -+const int* hf_amqp_1_0_rejected_items[] = { &hf_amqp_1_0_error }; -+const int* hf_amqp_1_0_modified_items[] = { &hf_amqp_1_0_deliveryFailed, -+ &hf_amqp_1_0_undeliverableHere, -+ &hf_amqp_1_0_messageAnnotations }; -+const int* hf_amqp_1_0_source_items[] = { &hf_amqp_1_0_address, -+ &hf_amqp_1_0_terminusDurable, -+ &hf_amqp_1_0_expiryPolicy, -+ &hf_amqp_1_0_timeout, -+ &hf_amqp_1_0_dynamic, -+ &hf_amqp_1_0_dynamicNodeProperties, -+ &hf_amqp_1_0_distributionMode, -+ &hf_amqp_1_0_filter, -+ &hf_amqp_1_0_defaultOutcome, -+ &hf_amqp_1_0_outcomes, -+ &hf_amqp_1_0_capabilities }; -+const int* hf_amqp_1_0_target_items[] = { &hf_amqp_1_0_address, -+ &hf_amqp_1_0_terminusDurable, -+ &hf_amqp_1_0_expiryPolicy, -+ &hf_amqp_1_0_timeout, -+ &hf_amqp_1_0_dynamic, -+ &hf_amqp_1_0_dynamicNodeProperties, -+ &hf_amqp_1_0_capabilities }; -+const int* hf_amqp_1_0_messageProperties_items[] = { &hf_amqp_1_0_messageId, -+ &hf_amqp_1_0_userId, -+ &hf_amqp_1_0_to, -+ &hf_amqp_1_0_subject, -+ &hf_amqp_1_0_replyTo, -+ &hf_amqp_1_0_correlationId, -+ &hf_amqp_1_0_contentType, -+ &hf_amqp_1_0_contentEncoding, -+ &hf_amqp_1_0_absoluteExpiryTime, -+ &hf_amqp_1_0_creationTime, -+ &hf_amqp_1_0_groupId, -+ &hf_amqp_1_0_groupSequence, -+ &hf_amqp_1_0_replyToGroupId }; -+const int* hf_amqp_1_0_coordinator_items[] = { &hf_amqp_1_0_capabilities }; -+const int* hf_amqp_1_0_declare_items[] = { &hf_amqp_1_0_globalId }; -+const int* hf_amqp_1_0_discharge_items[] = { &hf_amqp_1_0_txnId, -+ &hf_amqp_1_0_fail }; -+const int* hf_amqp_1_0_declared_items[] = { &hf_amqp_1_0_txnId }; -+const int* hf_amqp_1_0_transactionalState_items[] = { &hf_amqp_1_0_txnId, -+ &hf_amqp_1_0_outcome }; - - /* 0-10 handles */ - -@@ -1360,10 +2141,12 @@ static int hf_amqp_header_tunnel_durable = -1; - static int hf_amqp_header_tunnel_broadcast = -1; - static int hf_amqp_payload = -1; - static int hf_amqp_init_protocol = -1; -+static int hf_amqp_init_id = -1; - static int hf_amqp_init_id_major = -1; - static int hf_amqp_init_id_minor = -1; - static int hf_amqp_init_version_major = -1; - static int hf_amqp_init_version_minor = -1; -+static int hf_amqp_init_version_revision = -1; - - static gint ett_amqp = -1; - static gint ett_header = -1; -@@ -1373,9 +2156,87 @@ static gint ett_field_table = -1; - static gint ett_amqp_init = -1; - static gint ett_amqp_0_10_map = -1; - static gint ett_amqp_0_10_array = -1; -+static gint ett_amqp_1_0_list = -1; -+static gint ett_amqp_1_0_array = -1; -+static gint ett_amqp_1_0_map = -1; - - /* Various enumerations */ - -+static const value_string amqp_1_0_SASL_code_value [] = { -+ {0, "ok"}, -+ {1, "auth"}, -+ {2, "sys"}, -+ {3, "sys-perm"}, -+ {4, "sys-temp"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_role_value [] = { -+ {0x40, "null"}, -+ {0x41, "receiver"}, -+ {0x42, "sender"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_sndSettleMode_value[] = { -+ {0, "unsettled"}, -+ {1, "settled"}, -+ {2, "mixed"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_rcvSettleMode_value[] = { -+ {0, "first"}, -+ {1, "second"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_durable_value[] = { -+ {0, "none"}, -+ {1, "configuration"}, -+ {2, "unsettled-state"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_AMQP_performatives [] = { -+ {AMQP_1_0_AMQP_OPEN, "open"}, -+ {AMQP_1_0_AMQP_BEGIN, "begin"}, -+ {AMQP_1_0_AMQP_ATTACH, "attach"}, -+ {AMQP_1_0_AMQP_FLOW, "flow"}, -+ {AMQP_1_0_AMQP_TRANSFER, "transfer"}, -+ {AMQP_1_0_AMQP_DISPOSITION, "disposition"}, -+ {AMQP_1_0_AMQP_DETACH, "detach"}, -+ {AMQP_1_0_AMQP_END, "end"}, -+ {AMQP_1_0_AMQP_CLOSE, "close"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_SASL_methods [] = { -+ {AMQP_1_0_SASL_MECHANISMS, "sasl.mechanisms"}, -+ {AMQP_1_0_SASL_INIT, "sasl.init"}, -+ {AMQP_1_0_SASL_CHALLENGE, "sasl.challenge"}, -+ {AMQP_1_0_SASL_RESPONSE, "sasl.response"}, -+ {AMQP_1_0_SASL_OUTCOME, "sasl.outcome"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_type [] = { -+ {AMQP_1_0_AMQP_FRAME, "AMQP"}, -+ {AMQP_1_0_SASL_FRAME, "SASL"}, -+ {AMQP_1_0_TLS_FRAME, "TLS"}, -+ {0, NULL} -+}; -+ -+static const value_string amqp_1_0_encoding_width0 [] = { -+ {0x40, "null"}, -+ {0x41, "true"}, -+ {0x42, "false"}, -+ {0x43, "0"}, -+ {0x44, "0"}, -+ {0x45, "empty list"}, -+ {0, NULL} -+}; -+ - static const value_string amqp_0_10_frame_position [] = { - {0x00, "----"}, - {0x01, "---e"}, -@@ -1844,6 +2705,70 @@ static struct amqp_typeinfo amqp_0_10_var_types[] = { - { 0xff, "end", 0, 0 } - }; - -+/* AMQP 1.0 Type Info */ -+static struct amqp_typeinfo amqp_1_0_fixed_types[] = { -+ { 0x40, "null", format_amqp_1_0_null, 0 }, -+ { 0x41, "bool", format_amqp_1_0_boolean_true, 0 }, -+ { 0x42, "bool", format_amqp_1_0_boolean_false,0 }, -+ { 0x56, "bool", format_amqp_1_0_boolean, 1 }, -+ { 0x50, "ubyte", format_amqp_1_0_uint, 1 }, -+ { 0x60, "ushort", format_amqp_1_0_uint, 2 }, -+ { 0x70, "uint", format_amqp_1_0_uint, 4 }, -+ { 0x52, "smalluint", format_amqp_1_0_uint, 1 }, -+ { 0x43, "uint0", format_amqp_1_0_uint, 0 }, -+ { 0x80, "ulong", format_amqp_1_0_uint, 8 }, -+ { 0x53, "smallulong", format_amqp_1_0_uint, 1 }, -+ { 0x44, "ulong0", format_amqp_1_0_uint, 0 }, -+ { 0x51, "byte", format_amqp_1_0_int, 1 }, -+ { 0x61, "short", format_amqp_1_0_int, 2 }, -+ { 0x71, "int", format_amqp_1_0_int, 4 }, -+ { 0x54, "smallint", format_amqp_1_0_int, 1 }, -+ { 0x81, "long", format_amqp_1_0_int, 8 }, -+ { 0x55, "smalllong", format_amqp_1_0_int, 1 }, -+ { 0x72, "float", format_amqp_1_0_float, 4 }, -+ { 0x82, "double", format_amqp_1_0_double, 8 }, -+ { 0x73, "char", format_amqp_1_0_char, 4 }, -+ { 0x83, "timestamp", format_amqp_1_0_timestamp, 8 }, -+ { 0x98, "uuid", format_amqp_1_0_uuid, 16 }, -+ { 0xa0, "vbin8", format_amqp_1_0_bin, 1 }, -+ { 0xb0, "vbin32", format_amqp_1_0_bin, 4 }, -+ { 0xa1, "str8-utf8", format_amqp_1_0_str, 1 }, -+ { 0xb1, "str32-utf8", format_amqp_1_0_str, 4 }, -+ { 0xa3, "sym8", format_amqp_1_0_symbol, 1 }, -+ { 0xb3, "sym32", format_amqp_1_0_symbol, 4 }, -+ { 0xff, "end", 0, 0 } -+}; -+ -+/* see explanation at declaration of amqp_defined_types_t */ -+static struct amqp_defined_types_t amqp_1_0_defined_types[] = { -+ {AMQP_1_0_AMQP_TYPE_ERROR, &hf_amqp_1_0_error, 3, hf_amqp_1_0_error_items }, -+ {AMQP_1_0_AMQP_TYPE_HEADER, &hf_amqp_1_0_messageHeader, 5, hf_amqp_1_0_messageHeader_items }, -+ {AMQP_1_0_AMQP_TYPE_DELIVERY_ANNOTATIONS, &hf_amqp_1_0_deliveryAnnotations, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_MESSAGE_ANNOTATIONS, &hf_amqp_1_0_messageAnnotations, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_PROPERTIES, &hf_amqp_1_0_messageProperties, 13, hf_amqp_1_0_messageProperties_items }, -+ {AMQP_1_0_AMQP_TYPE_APPLICATION_PROPERTIES, &hf_amqp_1_0_applicationProperties, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_DATA, &hf_amqp_1_0_data, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_AMQP_SEQUENCE, &hf_amqp_1_0_amqp_sequence, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_AMQP_VALUE, &hf_amqp_1_0_amqp_value, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_FOOTER, &hf_amqp_1_0_footer, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_RECEIVED, &hf_amqp_1_0_received, 2, hf_amqp_1_0_received_items }, -+ {AMQP_1_0_AMQP_TYPE_ACCEPTED, &hf_amqp_1_0_accepted, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_REJECTED, &hf_amqp_1_0_rejected, 1, hf_amqp_1_0_rejected_items }, -+ {AMQP_1_0_AMQP_TYPE_RELEASED, &hf_amqp_1_0_released, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_MODIFIED, &hf_amqp_1_0_modified, 3, hf_amqp_1_0_modified_items }, -+ {AMQP_1_0_AMQP_TYPE_SOURCE, &hf_amqp_1_0_source, 11, hf_amqp_1_0_source_items }, -+ {AMQP_1_0_AMQP_TYPE_TARGET, &hf_amqp_1_0_target, 7, hf_amqp_1_0_target_items }, -+ {AMQP_1_0_AMQP_TYPE_DELETE_ON_CLOSE, &hf_amqp_1_0_deleteOnClose, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_DELETE_ON_NO_LINKS, &hf_amqp_1_0_deleteOnNoLinks, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_DELETE_ON_NO_MESSAGE, &hf_amqp_1_0_deleteOnNoMessages, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_DELETE_ON_NO_LINKS_OR_MESSAGE, &hf_amqp_1_0_deleteOnNoLinksOrMessages, 0, NULL }, -+ {AMQP_1_0_AMQP_TYPE_COORDINATOR, &hf_amqp_1_0_coordinator, 1, hf_amqp_1_0_coordinator_items }, -+ {AMQP_1_0_AMQP_TYPE_DECLARE, &hf_amqp_1_0_declare, 1, hf_amqp_1_0_declare_items }, -+ {AMQP_1_0_AMQP_TYPE_DISCHARGE, &hf_amqp_1_0_discharge, 2, hf_amqp_1_0_discharge_items }, -+ {AMQP_1_0_AMQP_TYPE_DECLARED, &hf_amqp_1_0_declared, 1, hf_amqp_1_0_declared_items }, -+ {AMQP_1_0_AMQP_TYPE_TRANSACTIONAL_STATE, &hf_amqp_1_0_transactionalState, 2, hf_amqp_1_0_transactionalState_items }, -+ { 0, NULL, 0, NULL } -+}; - - /* Main dissection routine */ - -@@ -1882,6 +2807,11 @@ dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) - dissector = dissect_amqp_0_10_frame; - fixed_length = 8; - break; -+ case AMQP_V1_0: -+ length_getter = &get_amqp_1_0_message_len; -+ dissector = dissect_amqp_1_0_frame; -+ fixed_length = 8; -+ break; - default: - col_append_str(pinfo->cinfo, COL_INFO, "AMQP (unknown version)"); - col_set_fence(pinfo->cinfo, COL_INFO); -@@ -1906,15 +2836,22 @@ check_amqp_version(tvbuff_t *tvb, amqp_conv *conn) - return; - - if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) { -- guint8 proto_major; -- guint8 proto_minor; -- -- proto_major = tvb_get_guint8(tvb, 6); -- proto_minor = tvb_get_guint8(tvb, 7); -- if (proto_major == 0) { -- if (proto_minor == 9) -+ /* AMQP 0-* has protocol major/minor in 6th/7th byte, while AMQP 1.0 -+ * has it in 5th/6th byte (7th is revision) -+ */ -+ guint8 fivth_byte; -+ guint8 sixth_byte; -+ guint8 seventh_byte; -+ -+ fivth_byte = tvb_get_guint8(tvb, 5); -+ sixth_byte = tvb_get_guint8(tvb, 6); -+ seventh_byte = tvb_get_guint8(tvb, 7); -+ if ((fivth_byte == 1) && (sixth_byte == 0) && (seventh_byte == 0)) -+ conn->version = AMQP_V1_0; -+ else if (sixth_byte == 0) { -+ if (seventh_byte == 9) - conn->version = AMQP_V0_9; -- else if (proto_minor == 10) -+ else if (seventh_byte == 10) - conn->version = AMQP_V0_10; - } - return; -@@ -1925,18 +2862,30 @@ check_amqp_version(tvbuff_t *tvb, amqp_conv *conn) - * deduce it from the content. First indicator is the frame length. 0-9 - * has a 32-bit length in octets 3-7. If the frame length is the same - * as the PDU length and there's a frame end where it should be, this -- * is 0-9. Else assume 0-10. -+ * is 0-9. Else, higher version. 0-10 has 5th octet 0x00 while 1.0 has -+ * there at least 2 (DOFF) - use this fact to determine. - */ - f0_9_length = tvb_get_ntohl(tvb, 3) + 7 + 1; /* Add header and end */ - if ((f0_9_length == tvb_reported_length(tvb)) && - (tvb_get_guint8(tvb, f0_9_length - 1) == 0xCE)) - conn->version = AMQP_V0_9; -- else -+ else if (tvb_get_guint8(tvb, 4) == 0x00) - conn->version = AMQP_V0_10; -+ else -+ conn->version = AMQP_V1_0; - return; - } - - static guint -+get_amqp_1_0_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) -+{ -+ /* Heuristic - protocol initialisation frame starts with 'AMQP' */ -+ if (tvb_memeql(tvb, offset, "AMQP", 4) == 0) -+ return 8; -+ return (guint) tvb_get_ntohl(tvb, offset); -+} -+ -+static guint - get_amqp_0_10_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) - { - /* Heuristic - protocol initialisation frame starts with 'AMQP' */ -@@ -2017,7 +2966,7 @@ dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guin - amqp_typename = "integer"; - if (length < 4) - goto too_short; -- value = ep_strdup_printf("%d", tvb_get_ntohl(tvb, offset)); -+ value = wmem_strdup_printf(wmem_packet_scope(), "%d", tvb_get_ntohl(tvb, offset)); - offset += 4; - length -= 4; - break; -@@ -2232,7 +3181,7 @@ dissect_amqp_0_10_array(tvbuff_t *tvb, - element_count = tvb_get_ntohl(tvb, offset); - AMQP_INCREMENT(offset, 4, bound); - length -= 4; -- proto_item_append_text(item, " (%d elements)", element_count); -+ proto_item_append_text(item, " (array of %d element%s)", element_count, element_suffix[element_count!=1]); - if (element_count > 1) - array_tree = proto_item_add_subtree(item, ett_amqp_0_10_array); - while ((element_count > 0) && (length > 0)) { -@@ -5596,16 +6545,16 @@ dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) - if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) { - guint8 proto_major; - guint8 proto_minor; -- emem_strbuf_t *strbuf; -+ wmem_strbuf_t *strbuf; - - proto_major = tvb_get_guint8(tvb, 6); - proto_minor = tvb_get_guint8(tvb, 7); -- strbuf = ep_strbuf_new_label(""); -- ep_strbuf_append_printf(strbuf, -- "Protocol-Header %d-%d ", -- proto_major, -- proto_minor); -- col_append_str(pinfo->cinfo, COL_INFO, strbuf->str); -+ strbuf = wmem_strbuf_new_label(wmem_packet_scope()); -+ wmem_strbuf_append_printf(strbuf, -+ "Protocol-Header %d-%d ", -+ proto_major, -+ proto_minor); -+ col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(strbuf)); - col_set_fence(pinfo->cinfo, COL_INFO); - - if (tree) { -@@ -5741,16 +6690,16 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) - if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) { - guint8 proto_major; - guint8 proto_minor; -- emem_strbuf_t *strbuf; -+ wmem_strbuf_t *strbuf; - - proto_major = tvb_get_guint8(tvb, 6); - proto_minor = tvb_get_guint8(tvb, 7); -- strbuf = ep_strbuf_new_label(""); -- ep_strbuf_append_printf(strbuf, -- "Protocol-Header %u-%u", -- proto_major, -- proto_minor); -- col_append_str(pinfo->cinfo, COL_INFO, strbuf->str); -+ strbuf = wmem_strbuf_new_label(wmem_packet_scope()); -+ wmem_strbuf_append_printf(strbuf, -+ "Protocol-Header %u-%u", -+ proto_major, -+ proto_minor); -+ col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(strbuf)); - col_set_fence(pinfo->cinfo, COL_INFO); - - if (tree) { -@@ -6410,88 +7359,751 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) - - /* Dissection routine for method Connection.Start */ - --static int --dissect_amqp_0_9_method_connection_start(tvbuff_t *tvb, packet_info *pinfo, -- int offset, proto_tree *args_tree) -+/* decodes AMQP 1.0 list -+ * arguments: -+ * tvb: obvious -+ * pinfo: obvious -+ * offset: obvious -+ * bound: boundary within that the list has to end -+ * item: obvious -+ * hf_amqp_type: what hf_* type is the list itself -+ * hf_amqp_subtype_count: length of hf_amqp_subtypes -+ * hf_amqp_subtypes: what hf_* types are the list items -+ * name: what to show for unformatted content -+ */ -+static guint -+dissect_amqp_1_0_list(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ proto_item *item, -+ int hf_amqp_type, -+ int hf_amqp_subtype_count, -+ const int **hf_amqp_subtypes, -+ const char *name) - { -- proto_item *ti; -- -- /* version-major (octet) */ -- proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_major, -- tvb, offset, 1, ENC_BIG_ENDIAN); -- offset += 1; -- -- /* version-minor (octet) */ -- proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_minor, -- tvb, offset, 1, ENC_BIG_ENDIAN); -- offset += 1; -- -- /* server-properties (table) */ -- ti = proto_tree_add_item( -- args_tree, hf_amqp_method_connection_start_server_properties, -- tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -- dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti); -- offset += 4 + tvb_get_ntohl(tvb, offset); -- -- /* mechanisms (longstr) */ -- proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_start_mechanisms, -- tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -- offset += 4 + tvb_get_ntohl(tvb, offset); -- -- /* locales (longstr) */ -- proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_start_locales, -- tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -- offset += 4 + tvb_get_ntohl(tvb, offset); -+ proto_item *list_tree; -+ guint8 type; -+ guint8 count_len; -+ guint32 element_count; -+ guint32 element_size; -+ guint32 decoded_element_size; -+ guint32 orig_offset; -+ int decoded_elements; -+ int hf_amqp_item; -+ -+ list_tree = 0; -+ decoded_elements = 0; -+ orig_offset = offset; -+ type = tvb_get_guint8(tvb, offset); -+ AMQP_INCREMENT(offset, 1, bound); -+ switch (type) { -+ case AMQP_1_0_TYPE_LIST0: -+ count_len = 0; -+ element_size = 0; -+ element_count = 0; -+ break; -+ case AMQP_1_0_TYPE_LIST8: -+ count_len = 1; -+ element_size = tvb_get_guint8(tvb, offset); -+ element_count = tvb_get_guint8(tvb, offset+count_len); -+ break; -+ case AMQP_1_0_TYPE_LIST32: -+ count_len = 4; -+ element_size = tvb_get_ntohl(tvb, offset); -+ element_count = tvb_get_ntohl(tvb, offset+count_len); -+ break; -+ default: -+ proto_tree_add_none_format(list_tree, hf_amqp_1_0_list, tvb, -+ offset-1, -+ 1, -+ "(unknown type %d)", -+ type); -+ expert_add_info_format(pinfo, -+ list_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown AMQP list type %d", -+ type); -+ return bound-orig_offset; -+ } -+ AMQP_INCREMENT(offset, count_len*2, bound); -+ list_tree = add_1_0_proto_item(item, -+ tvb, -+ offset-1-count_len*2, -+ element_size+1+count_len, -+ hf_amqp_type, -+ name); -+ if (element_count > 0) -+ list_tree = proto_item_add_subtree(list_tree, ett_amqp_1_0_list); -+ proto_item_append_text(list_tree, " (list of %d element%s)", element_count, element_suffix[element_count!=1]); -+ -+ if (element_count > element_size) -+ { -+ expert_add_info_format(pinfo, -+ list_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Number of list elements (%d) bigger than list size (%d)", -+ element_count, element_size); -+ return bound-orig_offset; -+ } - -- return offset; -+ while ((element_count > 0) && (offset < bound)) { -+ decoded_element_size = 0; -+ if (decoded_elements 0) -+ expert_add_info_format(pinfo, -+ list_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Number of list elements (%d) not matching number of decoded elements (%d)", -+ element_count+decoded_elements, decoded_elements); -+ return offset-orig_offset; - } - --/* Dissection routine for method Connection.Start-Ok */ -- --static int --dissect_amqp_0_9_method_connection_start_ok(tvbuff_t *tvb, packet_info *pinfo, -- int offset, proto_tree *args_tree) -+/* decodes AMQP 1.0 map -+ * arguments: see dissect_amqp_1_0_list -+ */ -+static guint -+dissect_amqp_1_0_map(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ proto_item *item, -+ int hf_amqp_type, -+ const char *name) - { -- proto_item *ti; -+ proto_item *map_tree; -+ guint8 type; -+ guint8 count_len; -+ guint32 element_count; -+ guint32 element_size; -+ guint32 decoded_element_size; -+ guint8 decoded_width_size; -+ guint32 orig_offset; -+ const char *type_name = NULL; -+ const char *value = NULL; -+ -+ map_tree = 0; -+ orig_offset = offset; -+ type = tvb_get_guint8(tvb, offset); -+ AMQP_INCREMENT(offset, 1, bound); -+ switch (type) { -+ case AMQP_1_0_TYPE_MAP8: -+ count_len = 1; -+ element_size = tvb_get_guint8(tvb, offset); -+ element_count = tvb_get_guint8(tvb, offset+count_len); -+ break; -+ case AMQP_1_0_TYPE_MAP32: -+ count_len = 4; -+ element_size = tvb_get_ntohl(tvb, offset); -+ element_count = tvb_get_ntohl(tvb, offset+count_len); -+ break; -+ default: -+ proto_tree_add_none_format(map_tree, hf_amqp_1_0_map, tvb, -+ offset-1, -+ 1, -+ "(unknown type %d)", -+ type); -+ expert_add_info_format(pinfo, -+ map_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown AMQP map type %d", -+ type); -+ return bound-orig_offset; -+ } -+ AMQP_INCREMENT(offset, count_len*2, bound); -+ map_tree = add_1_0_proto_item(item, -+ tvb, -+ offset-1-count_len*2, -+ element_size+1+count_len, -+ hf_amqp_type, -+ name); -+ if (element_count > 0) -+ map_tree = proto_item_add_subtree(map_tree, ett_amqp_1_0_map); -+ if (element_count%2==1) { -+ expert_add_info_format(pinfo, -+ map_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Odd number of map items: %d", -+ element_count); -+ return bound-orig_offset; -+ } - -- /* client-properties (table) */ -- ti = proto_tree_add_item( -- args_tree, hf_amqp_method_connection_start_ok_client_properties, -- tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -- dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti); -- offset += 4 + tvb_get_ntohl(tvb, offset); -+ if (element_count > element_size) -+ { -+ expert_add_info_format(pinfo, -+ map_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Number of map elements (%d) bigger than map size (%d)", -+ element_count, element_size); -+ return bound-orig_offset; -+ } - -- /* mechanism (shortstr) */ -- proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_mechanism, -- tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA); -- offset += 1 + tvb_get_guint8(tvb, offset); -+ proto_item_append_text(map_tree, -+ " (map of %d element%s)", -+ (element_count/2), -+ element_suffix[(element_count/2)!=1]); -+ -+ while (element_count > 0) { -+ if (element_count%2 == 0) { /* decode key */ -+ if (!decode_fixed_type(tvb, -+ tvb_get_guint8(tvb, offset), -+ offset+1, -+ bound, -+ &decoded_width_size, -+ &decoded_element_size, -+ &type_name, -+ &value)) { /* can't decode key type */ -+ proto_tree_add_none_format(map_tree, hf_amqp_1_0_map, tvb, -+ offset, -+ 1, -+ "(unknown map key type %d)", -+ tvb_get_guint8(tvb, offset)); -+ expert_add_info_format(pinfo, -+ map_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown AMQP map key type %d", -+ tvb_get_guint8(tvb, offset)); -+ decoded_element_size=0; -+ } -+ AMQP_INCREMENT(offset, decoded_element_size+1, bound); -+ } -+ else { /* decode value */ -+ get_amqp_1_0_type_value_formatter(tvb, -+ pinfo, -+ offset, -+ bound, -+ hf_amqp_1_0_map, -+ value, -+ &decoded_element_size, -+ map_tree); -+ AMQP_INCREMENT(offset, decoded_element_size, bound); -+ } -+ element_count--; -+ } -+ return offset-orig_offset; -+} - -- /* response (longstr) */ -- proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_response, -- tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -- offset += 4 + tvb_get_ntohl(tvb, offset); -+/* decodes AMQP 1.0 array -+ * arguments: see dissect_amqp_1_0_list -+ */ -+static guint -+dissect_amqp_1_0_array(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ proto_item *item, -+ int hf_amqp_type, -+ int hf_amqp_subtype_count, -+ const int **hf_amqp_subtypes, -+ const char *name) -+{ -+ proto_item *array_tree; -+ guint8 type; -+ guint8 count_len; -+ guint32 element_count; -+ guint32 element_size; -+ guint32 element_type; -+ guint32 decoded_element_size; -+ guint32 orig_offset; -+ int decoded_elements; -+ int hf_amqp_item; -+ int hf_amqp_subtype_count_array = 0; -+ const int **hf_amqp_subtypes_array = NULL; -+ const char *type_name_array = NULL; - -- /* locale (shortstr) */ -- proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_locale, -- tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA); -- offset += 1 + tvb_get_guint8(tvb, offset); -+ array_tree = 0; -+ decoded_elements = 0; -+ orig_offset = offset; -+ type = tvb_get_guint8(tvb, offset); -+ AMQP_INCREMENT(offset, 1, bound); -+ switch (type) { -+ case AMQP_1_0_TYPE_ARRAY8: -+ count_len = 1; -+ element_size = tvb_get_guint8(tvb, offset); -+ element_count = tvb_get_guint8(tvb, offset+count_len); -+ break; -+ case AMQP_1_0_TYPE_ARRAY32: -+ count_len = 4; -+ element_size = tvb_get_ntohl(tvb, offset); -+ element_count = tvb_get_ntohl(tvb, offset+count_len); -+ break; -+ default: -+ proto_tree_add_none_format(array_tree, hf_amqp_1_0_list, tvb, -+ offset-1, -+ 1, -+ "(unknown type %d)", -+ type); -+ expert_add_info_format(pinfo, -+ array_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown AMQP array type %d", -+ type); -+ return bound-orig_offset; -+ } -+ element_type = get_amqp_1_0_type_formatter(tvb, -+ offset+count_len*2, -+ bound, -+ &hf_amqp_type, -+ &type_name_array, -+ &hf_amqp_subtype_count_array, -+ &hf_amqp_subtypes_array, -+ &decoded_element_size); -+ AMQP_INCREMENT(offset, count_len*2+decoded_element_size, bound); -+ array_tree = add_1_0_proto_item(item, -+ tvb, -+ offset-1-count_len*2-decoded_element_size, -+ element_size+1+count_len, -+ hf_amqp_type, -+ name); -+ -+ if (element_count > 0) -+ array_tree = proto_item_add_subtree(array_tree, ett_amqp_1_0_array); -+ proto_item_append_text(array_tree, " (array of %d element%s)", element_count, element_suffix[element_count!=1]); -+ -+ if (element_count > element_size) -+ { -+ expert_add_info_format(pinfo, -+ array_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Number of array elements (%d) bigger than array size (%d)", -+ element_count, element_size); -+ return bound-orig_offset; -+ } - -- return offset; -+ while ((element_count > 0) && (offset < bound)) { -+ decoded_element_size = 0; -+ if (decoded_elementsname, /* name */ -+ hf_amqp_subtype_count_array, /* subitem list count */ -+ hf_amqp_subtypes_array, /* subitem list hf_.. list */ -+ &decoded_element_size, -+ array_tree); -+ element_count -= 1; -+ decoded_elements += 1; -+ if (decoded_element_size==0) -+ decoded_element_size=1; /* necessary for 0x40 or similar values where value_formatter returns size of _value_ 0 (type=1 not counted) */ -+ AMQP_INCREMENT(offset, decoded_element_size, bound); -+ } -+ if (element_count > 0) -+ expert_add_info_format(pinfo, -+ array_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Number of array elements (%d) not matching number of decoded elements (%d)", -+ element_count+decoded_elements, decoded_elements); -+ return offset-orig_offset; - } - --/* Dissection routine for method Connection.Secure */ -- --static int --dissect_amqp_0_9_method_connection_secure(tvbuff_t *tvb, -- int offset, proto_tree *args_tree) -+/* decodes AMQP 1.0 AMQP performative (open, attach, transfer or so) -+ * arguments: -+ * tvb, offset, length, amqp_tree, pinfo: obvious -+ * method_name: what to print to col_append_str method in dissect_amqp_1_0_frame -+ */ -+static guint32 -+dissect_amqp_1_0_AMQP_frame(tvbuff_t *tvb, -+ guint offset, -+ guint16 bound, -+ proto_item *amqp_tree, -+ packet_info *pinfo, -+ const gchar **method_name) - { -- /* challenge (longstr) */ -- proto_tree_add_item(args_tree, hf_amqp_method_connection_secure_challenge, -- tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -- offset += 4 + tvb_get_ntohl(tvb, offset); -- -- return offset; --} -+ proto_item *args_tree; -+ guint32 arg_length = 0; -+ guint8 method; -+ guint orig_offset = offset; -+ -+ if (bound == offset) { /* empty keepalive sent */ -+ *method_name = "(empty)"; -+ return 0; -+ } -+ args_tree = proto_item_add_subtree(amqp_tree, ett_args); -+ method = tvb_get_guint8(tvb, offset+2); -+ *method_name = val_to_str_const(method, amqp_1_0_AMQP_performatives, -+ ""); -+ proto_tree_add_item(args_tree, hf_amqp_1_0_amqp_performative, tvb, offset+2, 1, ENC_BIG_ENDIAN); -+ AMQP_INCREMENT(offset, 3, bound); /* descriptor-constructor & fixed_one length & AMQP performative code */ -+ switch(method) { -+ case AMQP_1_0_AMQP_OPEN: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 10, hf_amqp_1_0_amqp_open_items, NULL); -+ break; -+ case AMQP_1_0_AMQP_BEGIN: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 8, hf_amqp_1_0_amqp_begin_items, NULL); -+ break; -+ case AMQP_1_0_AMQP_ATTACH: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 14, hf_amqp_1_0_amqp_attach_items, NULL); -+ break; -+ case AMQP_1_0_AMQP_FLOW: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 11, hf_amqp_1_0_amqp_flow_items, NULL); -+ break; -+ case AMQP_1_0_AMQP_TRANSFER: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 11, hf_amqp_1_0_amqp_transfer_items, NULL); -+ /* now decode message header, annotations, properties and data */ -+ while (offset+arg_length < bound) { -+ AMQP_INCREMENT(offset, arg_length, bound); -+ get_amqp_1_0_type_value_formatter(tvb, -+ pinfo, -+ offset, -+ bound, -+ hf_amqp_method_arguments, /* should be re-written */ -+ NULL, -+ &arg_length, -+ args_tree); -+ } -+ break; -+ case AMQP_1_0_AMQP_DISPOSITION: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 6, hf_amqp_1_0_amqp_disposition_items, NULL); -+ break; -+ case AMQP_1_0_AMQP_DETACH: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 3, hf_amqp_1_0_amqp_detach_items, NULL); -+ break; -+ case AMQP_1_0_AMQP_END: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 1, hf_amqp_1_0_amqp_end_items, NULL); -+ break; -+ case AMQP_1_0_AMQP_CLOSE: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 1, hf_amqp_1_0_amqp_close_items, NULL); -+ break; -+ default: -+ expert_add_info_format(pinfo, -+ amqp_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown AMQP performative %d", -+ tvb_get_guint8(tvb, offset + 2)); -+ return bound-orig_offset; -+ } -+ return (arg_length) + (offset-orig_offset); -+} -+ -+/* decodes AMQP 1.0 SASL methods (mechanisms offer, challenge, response,..) -+ * arguments: see dissect_amqp_1_0_AMQP_frame -+ */ -+static guint32 -+dissect_amqp_1_0_SASL_frame(tvbuff_t *tvb, -+ guint offset, -+ guint16 bound, -+ proto_item *amqp_tree, -+ packet_info *pinfo, -+ const gchar **method_name) -+{ -+ proto_item *args_tree; -+ guint32 arg_length = 0; -+ guint8 method; -+ guint orig_offset = offset; -+ -+ args_tree = proto_item_add_subtree(amqp_tree, ett_args); -+ method = tvb_get_guint8(tvb, offset+2); -+ *method_name = val_to_str_const(method, amqp_1_0_SASL_methods, -+ ""); -+ proto_tree_add_item(args_tree, hf_amqp_1_0_sasl_method, tvb, offset+2, 1, ENC_BIG_ENDIAN); -+ -+ AMQP_INCREMENT(offset, 3, bound); /* descriptor-constructor & fixed_one length & SASL method code */ -+ switch(method) { -+ case AMQP_1_0_SASL_MECHANISMS: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 1, hf_amqp_1_0_sasl_mechanisms_items, NULL); -+ break; -+ case AMQP_1_0_SASL_INIT: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 3, hf_amqp_1_0_sasl_init_items, NULL); -+ break; -+ case AMQP_1_0_SASL_CHALLENGE: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 1, hf_amqp_1_0_sasl_challenge_items, NULL); -+ break; -+ case AMQP_1_0_SASL_RESPONSE: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 1, hf_amqp_1_0_sasl_response_items, NULL); -+ break; -+ case AMQP_1_0_SASL_OUTCOME: -+ arg_length = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset, -+ bound, -+ args_tree, -+ hf_amqp_method_arguments, -+ 2, hf_amqp_1_0_sasl_outcome_items, NULL); -+ break; -+ default: -+ expert_add_info_format(pinfo, -+ amqp_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown SASL command %d", -+ tvb_get_guint8(tvb, offset + 2)); -+ return bound-orig_offset; -+ } -+ return (arg_length) + (offset-orig_offset); -+} -+ -+static void -+dissect_amqp_1_0_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -+{ -+ proto_item *ti = NULL; -+ proto_item *amqp_tree = NULL; -+ guint8 frame_type; -+ guint16 length; -+ guint32 arg_length = 0; -+ guint offset; -+ const gchar *method_name = NULL; -+ -+#if 0 /* XXX: Not currently used ?? */ -+ conversation_t *conv; -+ amqp_conv *conn; -+ -+ /* Find (or build) conversation to remember the protocol version */ -+ conv = find_or_create_conversation(pinfo); -+ conn = conversation_get_proto_data(conv, proto_amqp); -+#endif -+ -+ col_clear(pinfo->cinfo, COL_INFO); -+ -+ /* Heuristic - protocol initialisation frame starts with 'AMQP' followed by 0x0 */ -+ if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) { -+ guint8 proto_major; -+ guint8 proto_minor; -+ guint8 proto_revision; -+ wmem_strbuf_t *strbuf; -+ -+ proto_major = tvb_get_guint8(tvb, 5); -+ proto_minor = tvb_get_guint8(tvb, 6); -+ proto_revision = tvb_get_guint8(tvb, 7); -+ strbuf = wmem_strbuf_new_label(wmem_packet_scope()); -+ wmem_strbuf_append_printf(strbuf, -+ "Protocol-Header%s %d-%d-%d ", -+ (tvb_get_guint8(tvb, 4)==0x2) ? "(TLS)" : "", /* frame type = 2 => TLS */ -+ proto_major, -+ proto_minor, -+ proto_revision); -+ col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(strbuf)); -+ col_set_fence(pinfo->cinfo, COL_INFO); -+ -+ if (tree) { -+ ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, ENC_NA); -+ amqp_tree = proto_item_add_subtree(ti, ett_amqp_init); -+ proto_tree_add_item(amqp_tree, hf_amqp_init_protocol, tvb, 0, 4, ENC_ASCII|ENC_NA); -+ proto_tree_add_item(amqp_tree, hf_amqp_init_id, tvb, 4, 1, ENC_BIG_ENDIAN); -+ proto_tree_add_item(amqp_tree, hf_amqp_init_version_major, tvb, 5, 1, ENC_BIG_ENDIAN); -+ proto_tree_add_item(amqp_tree, hf_amqp_init_version_minor, tvb, 6, 1, ENC_BIG_ENDIAN); -+ proto_tree_add_item(amqp_tree, hf_amqp_init_version_revision, tvb, 7, 1, ENC_BIG_ENDIAN); -+ } -+ return; -+ } -+ -+ /* Protocol frame */ -+ if (tree) { -+ /* frame header */ -+ ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, ENC_NA); -+ amqp_tree = proto_item_add_subtree(ti, ett_amqp); -+ proto_tree_add_item(amqp_tree, hf_amqp_1_0_size, tvb, 0, 4, ENC_BIG_ENDIAN); -+ proto_tree_add_item(amqp_tree, hf_amqp_1_0_doff, tvb, 4, 1, ENC_BIG_ENDIAN); -+ proto_tree_add_item(amqp_tree, hf_amqp_1_0_type, tvb, 5, 1, ENC_BIG_ENDIAN); -+ proto_tree_add_item(amqp_tree, hf_amqp_channel, tvb, 6, 2, ENC_BIG_ENDIAN); -+ } -+ -+ length = tvb_get_ntohl(tvb, 0); -+ offset = 4*tvb_get_guint8(tvb,4); /* i.e. 4*DOFF */ -+ frame_type = tvb_get_guint8(tvb, 5); -+ THROW_ON((length < offset), ReportedBoundsError); -+ -+ switch(frame_type) { -+ case AMQP_1_0_AMQP_FRAME: -+ arg_length = dissect_amqp_1_0_AMQP_frame(tvb, offset, length, amqp_tree, pinfo, &method_name); -+ break; -+ case AMQP_1_0_SASL_FRAME: -+ arg_length = dissect_amqp_1_0_SASL_frame(tvb, offset, length, amqp_tree, pinfo, &method_name); -+ break; -+ case AMQP_1_0_TLS_FRAME: -+ /* should not occur, this is handled in '(tvb_memeql(tvb, 0, "AMQP", 4) == 0)' test above */ -+ break; -+ default: -+ expert_add_info_format(pinfo, amqp_tree, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown frame type %d", -+ frame_type); -+ } -+ AMQP_INCREMENT(offset, arg_length, length); -+ col_append_str(pinfo->cinfo, COL_INFO, method_name); -+ col_append_str(pinfo->cinfo, COL_INFO, " "); -+ col_set_fence(pinfo->cinfo, COL_INFO); -+} -+ -+static int -+dissect_amqp_0_9_method_connection_start(tvbuff_t *tvb, packet_info *pinfo, -+ int offset, proto_tree *args_tree) -+{ -+ proto_item *ti; -+ -+ /* version-major (octet) */ -+ proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_major, -+ tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset += 1; -+ -+ /* version-minor (octet) */ -+ proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_minor, -+ tvb, offset, 1, ENC_BIG_ENDIAN); -+ offset += 1; -+ -+ /* server-properties (table) */ -+ ti = proto_tree_add_item( -+ args_tree, hf_amqp_method_connection_start_server_properties, -+ tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -+ dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti); -+ offset += 4 + tvb_get_ntohl(tvb, offset); -+ -+ /* mechanisms (longstr) */ -+ proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_start_mechanisms, -+ tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -+ offset += 4 + tvb_get_ntohl(tvb, offset); -+ -+ /* locales (longstr) */ -+ proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_start_locales, -+ tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -+ offset += 4 + tvb_get_ntohl(tvb, offset); -+ -+ return offset; -+} -+ -+/* Dissection routine for method Connection.Start-Ok */ -+ -+static int -+dissect_amqp_0_9_method_connection_start_ok(tvbuff_t *tvb, packet_info *pinfo, -+ int offset, proto_tree *args_tree) -+{ -+ proto_item *ti; -+ -+ /* client-properties (table) */ -+ ti = proto_tree_add_item( -+ args_tree, hf_amqp_method_connection_start_ok_client_properties, -+ tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -+ dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti); -+ offset += 4 + tvb_get_ntohl(tvb, offset); -+ -+ /* mechanism (shortstr) */ -+ proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_mechanism, -+ tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA); -+ offset += 1 + tvb_get_guint8(tvb, offset); -+ -+ /* response (longstr) */ -+ proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_response, -+ tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -+ offset += 4 + tvb_get_ntohl(tvb, offset); -+ -+ /* locale (shortstr) */ -+ proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_locale, -+ tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA); -+ offset += 1 + tvb_get_guint8(tvb, offset); -+ -+ return offset; -+} -+ -+/* Dissection routine for method Connection.Secure */ -+ -+static int -+dissect_amqp_0_9_method_connection_secure(tvbuff_t *tvb, -+ int offset, proto_tree *args_tree) -+{ -+ /* challenge (longstr) */ -+ proto_tree_add_item(args_tree, hf_amqp_method_connection_secure_challenge, -+ tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA); -+ offset += 4 + tvb_get_ntohl(tvb, offset); -+ -+ return offset; -+} - - /* Dissection routine for method Connection.Secure-Ok */ - -@@ -8546,6 +10158,543 @@ dissect_amqp_0_9_content_header_tunnel(tvbuff_t *tvb, packet_info *pinfo, - return offset; - } - -+/* AMQP 1.0 Type Decoders */ -+ -+/* knowing the primitive type (code), this routine decodes its value (using -+ * amqp_1_0_fixed_types) -+ * arguments: -+ * tvb, code, offset, bound: obvious -+ * type_length_size: number of bytes of value length for types with variable width -+ * length_size: number of bytes decoded by the routine -+ * type_name: string with code type -+ * value: string with type value -+ * return value: true iff code found in fixed sized codes -+ * false iff code is list, array or map (or unknown) -+ */ -+static gboolean decode_fixed_type(tvbuff_t *tvb, -+ guint8 code, -+ int offset, -+ int bound, -+ guint8 *type_width_size, -+ guint *length_size, -+ const char **type_name, -+ const char **value) -+{ -+ int i; -+ type_formatter formatter; -+ -+ for (i = 0; amqp_1_0_fixed_types[i].typecode != 0xff; ++i) { -+ if (amqp_1_0_fixed_types[i].typecode == code) { -+ *type_name = wmem_strdup(wmem_packet_scope(), amqp_1_0_fixed_types[i].amqp_typename); -+ formatter = amqp_1_0_fixed_types[i].formatter; -+ if (code/16 > 0x9) /* variable width code is 0xa[0-9] or 0xb[0-9] */ -+ *type_width_size = amqp_1_0_fixed_types[i].known_size; -+ else -+ *type_width_size = 0; -+ *length_size = formatter(tvb, offset, bound, amqp_1_0_fixed_types[i].known_size, value); -+ return TRUE; -+ } -+ } -+ return FALSE; -+} -+ -+static proto_item* -+add_1_0_proto_item(proto_item *item, -+ tvbuff_t *tvb, -+ int offset, -+ int length, -+ int hf_amqp_type, -+ const char *no_format_value) -+{ -+ proto_item *return_item; -+ if (length==0) /* show type constructor rather */ -+ { -+ length=1; -+ offset--; -+ } -+ -+ if (no_format_value!=NULL) -+ return_item = proto_tree_add_none_format(item, -+ hf_amqp_type, -+ tvb, -+ offset, -+ length, -+ "%s", -+ no_format_value); -+ else -+ return_item = proto_tree_add_item(item, -+ hf_amqp_type, -+ tvb, -+ offset, -+ length, -+ ENC_NA); -+ return return_item; -+} -+ -+/* For given code, the routine decodes its value, format & print output. -+ * If the code is compound type (array,list,map), it calls relevant -+ * dissect_* routines for decoding its items -+ * arguments: -+ * tvb, pinfo, code, offset, bound: obvious -+ * hf_amqp_type: what hf_* variable corresponds to type of the code -+ * name: name of type of this code (applicable to map items and type descriptor -+ * hf_amqp_subtype_count: for format code to be list, expected number of list items -+ * hf_amqp_subtypes: for format code to be list, field of hf_* variables of list items -+ * length_size: decoded length -+ */ -+static void -+get_amqp_1_0_value_formatter(tvbuff_t *tvb, -+ packet_info *pinfo, -+ guint8 code, -+ int offset, -+ int bound, -+ int hf_amqp_type, -+ const char *name, -+ int hf_amqp_subtype_count, -+ const int **hf_amqp_subtypes, -+ guint *length_size, -+ proto_item *item) -+{ -+ char *no_format_value = NULL; -+ const char *type_name = NULL; -+ const char *value = NULL; -+ guint8 width_size; -+ const int *hf_amqp_type_ptr; -+ -+ if (decode_fixed_type(tvb, code, offset, bound, &width_size, length_size, &type_name, &value)) -+ { -+ /* if AMQP variable can be of potentialy multiple length, modify hf_amqp_type to proper subtype -+ * according to code; code=0x4[0-e] means 0 octet length, 0x5[0-e] means 1, 6 means 2, 7 means 4, -+ * 8 means 8 and 9 means 16 octet length; variable width types decoded with meaning 1 */ -+ if ((hf_amqp_type<=hf_amqp_1_0_saslAdditionalData) && -+ (subtypes_for_hf_amqp_1_0[hf_amqp_type-hf_amqp_1_0_size] != NULL)) -+ { -+ /* message-id and correlation-id can be of so many so different types, -+ * that the subtypes_for_hf_amqp_1_0 table is different for them */ -+ if ((hf_amqp_type==hf_amqp_1_0_messageId)||(hf_amqp_type==hf_amqp_1_0_correlationId)) -+ { -+ switch (code) { -+ case 0xa1: -+ case 0xb1: /* string */ -+ hf_amqp_type_ptr = subtypes_for_hf_amqp_1_0[hf_amqp_type-hf_amqp_1_0_size][2]; -+ break; -+ case 0xa0: -+ case 0xb0: /* binary */ -+ hf_amqp_type_ptr = subtypes_for_hf_amqp_1_0[hf_amqp_type-hf_amqp_1_0_size][3]; -+ break; -+ default: /* ulong and uuid */ -+ hf_amqp_type_ptr = subtypes_for_hf_amqp_1_0[hf_amqp_type-hf_amqp_1_0_size][code/16-4]; -+ break; -+ } -+ } -+ else -+ { -+ hf_amqp_type_ptr = subtypes_for_hf_amqp_1_0[hf_amqp_type-hf_amqp_1_0_size][(code<0xa0)?(code/16-4):(1)]; -+ } -+ if (hf_amqp_type_ptr==NULL) { -+ expert_add_info_format(pinfo, -+ item, -+ PI_PROTOCOL, PI_ERROR, -+ "Can't match AMQP type %d(hex=%x, frame position: %d) to list field \"%s\"", -+ code, code, -+ offset, -+ (proto_registrar_get_nth(hf_amqp_type))->name); -+ *length_size = bound-offset; /* to stop dissecting */ -+ return; -+ } -+ hf_amqp_type = *hf_amqp_type_ptr; -+ } -+ if (name != NULL) -+ { -+ no_format_value = (char*) wmem_alloc(wmem_packet_scope(), MAX_BUFFER); -+ g_snprintf(no_format_value, MAX_BUFFER, "%s (%s): %s", name, type_name, value); -+ } -+ else if (hf_amqp_type==hf_amqp_1_0_list) -+ { -+ no_format_value = (char*) value; -+ } -+ add_1_0_proto_item(item, tvb, offset+width_size, (*length_size)-width_size, hf_amqp_type, no_format_value); -+ } -+ else { /* no fixed code, i.e. compound (list, map, array) */ -+ switch (code) { -+ case AMQP_1_0_TYPE_LIST0: -+ case AMQP_1_0_TYPE_LIST8: -+ case AMQP_1_0_TYPE_LIST32: -+ *length_size = dissect_amqp_1_0_list(tvb, -+ pinfo, -+ offset-1, /* "-1" due to decode type again in the method */ -+ bound, -+ item, -+ hf_amqp_type, -+ hf_amqp_subtype_count, -+ hf_amqp_subtypes, name)-1; /* "-1" due to decode type again in the method */ -+ break; -+ case AMQP_1_0_TYPE_MAP8: -+ case AMQP_1_0_TYPE_MAP32: -+ /* "-1" due to decode type again in the method */ -+ *length_size = dissect_amqp_1_0_map(tvb, pinfo, offset-1, bound, item, hf_amqp_type, name)-1; -+ break; -+ case AMQP_1_0_TYPE_ARRAY8: -+ case AMQP_1_0_TYPE_ARRAY32: -+ *length_size = dissect_amqp_1_0_array(tvb, -+ pinfo, -+ offset-1, /* "-1" due to decode type again in the method */ -+ bound, -+ item, -+ hf_amqp_type, -+ hf_amqp_subtype_count, -+ hf_amqp_subtypes, name)-1; /* "-1" due to decode type again in the method */ -+ break; -+ default: -+ expert_add_info_format(pinfo, -+ item, -+ PI_PROTOCOL, PI_ERROR, -+ "Unknown AMQP type %d(hex=%x)", -+ code, code); -+ *length_size = bound-offset; /* to stop dissecting */ -+ break; -+ } -+ } -+} -+ -+/* It decodes 1.0 type, including type constructor -+ * arguments: see get_amqp_1_0_value_formatter -+ * return code: decoded format code of primitive type -+ */ -+static guint -+get_amqp_1_0_type_formatter(tvbuff_t *tvb, -+ int offset, -+ int bound, -+ int *hf_amqp_type, -+ const char **name, -+ int *hf_amqp_subtype_count, -+ const int ***hf_amqp_subtypes, -+ guint *length_size) -+{ -+ int i; -+ int code; -+ int format_code_type; -+ guint format_len = 0; -+ guint orig_offset = offset; -+ -+ code = tvb_get_guint8(tvb, offset); -+ AMQP_INCREMENT(offset, 1, bound); -+ if (code == AMQP_1_0_TYPE_DESCRIPTOR_CONSTRUCTOR) { -+ format_code_type = tvb_get_guint8(tvb, offset); -+ AMQP_INCREMENT(offset, 1, bound); -+ if (format_code_type%16==0xf) { /* i.e. format codes like %x5F %x00-FF */ -+ AMQP_INCREMENT(offset, 1, bound); -+ } -+ switch (format_code_type/16) { -+ case 4: /* empty */ -+ format_len=0; -+ break; -+ case 5: /* fixed-one */ -+ format_len=1; -+ code = (int)tvb_get_guint8(tvb, offset); -+ break; -+ case 6: /* fixed-two */ -+ format_len=2; -+ code = (int)tvb_get_ntohs(tvb, offset); -+ break; -+ case 7: /* fixed-four */ -+ format_len=4; -+ code = (int)tvb_get_ntohl(tvb, offset); -+ break; -+ case 8: /* fixed-eight */ -+ format_len=8; -+ code = (int)tvb_get_ntoh64(tvb, offset); -+ /* TODO: use a gint64 for 32-bit platforms? we never compare it to -+ * anything bigger than an int anyways... */ -+ break; -+ case 9: /* fixed-sixteen */ -+ format_len=16; -+ /* TODO: somehow set code = next_128_bytes */ -+ break; -+ case 0xa: /* variable-one */ -+ format_len = format_amqp_1_0_str(tvb, offset, bound, 1, name); -+ break; -+ case 0xb: /* variable-four */ -+ format_len = format_amqp_1_0_str(tvb, offset, bound, 4, name); -+ break; -+ /* TODO: could be type compound? or array? */ -+ } -+ AMQP_INCREMENT(offset, format_len, bound); -+ for (i = 0; amqp_1_0_defined_types[i].format_code != 0x00; ++i) { -+ if (amqp_1_0_defined_types[i].format_code == code) { -+ *hf_amqp_type = *(amqp_1_0_defined_types[i].hf_amqp_type); -+ *hf_amqp_subtype_count = amqp_1_0_defined_types[i].hf_amqp_subtype_count; -+ *hf_amqp_subtypes = amqp_1_0_defined_types[i].hf_amqp_subtypes; -+ } -+ } -+ /* now take the real primitive format code */ -+ code = tvb_get_guint8(tvb, offset); -+ AMQP_INCREMENT(offset, 1, bound); -+ } -+ *length_size = (offset-orig_offset); -+ return code; -+} -+ -+/* It decodes both 1.0 type and its value, in fact it just calls -+ * get_amqp_1_0_type_formatter and get_amqp_1_0_value_formatter methods -+ * arguments: see get_amqp_1_0_value_formatter -+ */ -+static void -+get_amqp_1_0_type_value_formatter(tvbuff_t *tvb, -+ packet_info *pinfo, -+ int offset, -+ int bound, -+ int hf_amqp_type, /* what to print in GUI if name==NULL */ -+ const char *name, /* what to print in GUI */ -+ guint *length_size, /* decoded length */ -+ proto_item *item) -+{ -+ int code; -+ int hf_amqp_subtype_count = 0; -+ const int **hf_amqp_subtypes = NULL; -+ const char *type_name = NULL; -+ char *format_name = NULL; -+ guint type_length_size; -+ -+ code = get_amqp_1_0_type_formatter(tvb, -+ offset, -+ bound, -+ &hf_amqp_type, -+ &type_name, -+ &hf_amqp_subtype_count, -+ &hf_amqp_subtypes, -+ &type_length_size); -+ if ((name != NULL) || (type_name != NULL)) -+ { -+ if (type_name == NULL) -+ format_name=(char*)name; -+ else if (name == NULL) -+ format_name=(char*)format_name; -+ else -+ { -+ format_name = (char*) wmem_alloc(wmem_packet_scope(), MAX_BUFFER); -+ g_snprintf(format_name, MAX_BUFFER, "%s : %s", name, type_name); -+ } -+ } -+ AMQP_INCREMENT(offset, type_length_size, bound); -+ get_amqp_1_0_value_formatter(tvb, -+ pinfo, -+ code, -+ offset, -+ bound, -+ hf_amqp_type, -+ format_name, -+ hf_amqp_subtype_count, -+ hf_amqp_subtypes, -+ length_size, -+ item); -+ *length_size += type_length_size; -+} -+ -+static int -+format_amqp_1_0_null(tvbuff_t *tvb _U_, -+ guint offset _U_, guint bound _U_, guint length _U_, -+ const char **value _U_) -+{ -+ *value = "null"; -+ return 0; -+} -+ -+static int -+format_amqp_1_0_boolean_true(tvbuff_t *tvb _U_, -+ guint offset _U_, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ *value = wmem_strdup(wmem_packet_scope(), "true"); -+ return 0; -+} -+ -+static int -+format_amqp_1_0_boolean_false(tvbuff_t *tvb _U_, -+ guint offset _U_, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ *value = wmem_strdup(wmem_packet_scope(), "false"); -+ return 0; -+} -+ -+static int -+format_amqp_1_0_boolean(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ guint8 val; -+ -+ val = tvb_get_guint8(tvb, offset); -+ *value = wmem_strdup(wmem_packet_scope(), val ? "true" : "false"); -+ return 1; -+} -+ -+/* this covers ubyte, ushort, uint and ulong */ -+static int -+format_amqp_1_0_uint(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length, -+ const char **value) -+{ -+ guint64 val; -+ -+ if (length == 0) -+ val = 0; -+ else if (length == 1) -+ val = tvb_get_guint8(tvb, offset); -+ else if (length == 2) -+ val = tvb_get_ntohs(tvb, offset); -+ else if (length == 4) -+ val = tvb_get_ntohl(tvb, offset); -+ else if (length == 8) -+ val = tvb_get_ntoh64(tvb, offset); -+ else { -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid uint length %d!", length); -+ return length; -+ } -+ *value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "u", val); -+ return length; -+} -+ -+/* this covers byte, short, int and long */ -+static int -+format_amqp_1_0_int(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length, -+ const char **value) -+{ -+ gint64 val; -+ -+ if (length == 1) -+ val = (gint8)tvb_get_guint8(tvb, offset); -+ else if (length == 2) -+ val = (gint16)tvb_get_ntohs(tvb, offset); -+ else if (length == 4) -+ val = (gint32)tvb_get_ntohl(tvb, offset); -+ else if (length == 8) -+ val = (gint64)tvb_get_ntoh64(tvb, offset); -+ else { -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid int length %d!", length); -+ return length; -+ } -+ *value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "i", val); -+ return length; -+} -+ -+static int -+format_amqp_1_0_float(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ float floatval; -+ floatval = tvb_get_letohieee_float(tvb, offset); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "%f", floatval); -+ return 4; -+} -+ -+static int -+format_amqp_1_0_double(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ double doubleval; -+ doubleval = tvb_get_letohieee_double(tvb, offset); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "%f", doubleval); -+ return 8; -+} -+ -+/* TODO: add AMQP 1.0 decimal[32|64|128] primitive types */ -+ -+static int -+format_amqp_1_0_char(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ *value = tvb_format_text(tvb, offset, 1); -+ return 1; -+} -+ -+static int -+format_amqp_1_0_timestamp(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ *value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "d", tvb_get_ntoh64(tvb, offset)); -+ return 8; -+} -+ -+static int -+format_amqp_1_0_uuid(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length _U_, -+ const char **value) -+{ -+ e_guid_t uuid; -+ tvb_get_guid(tvb, offset, &uuid, ENC_BIG_ENDIAN); -+ *value = tvb_format_text(tvb, offset, 16); -+ return 1; -+} -+ -+static int -+format_amqp_1_0_bin(tvbuff_t *tvb, -+ guint offset, guint bound _U_, guint length, -+ const char **value) -+{ -+ guint bin_length; -+ -+ if (length == 1) -+ bin_length = tvb_get_guint8(tvb, offset); -+ else if (length == 4) -+ bin_length = tvb_get_ntohl(tvb, offset); -+ else { -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid binary length size %d!", length); -+ return length; -+ } -+ AMQP_INCREMENT(offset, length, bound); -+ *value = tvb_bytes_to_str(tvb, offset, bin_length); -+ return (length+bin_length); -+} -+ -+static int -+format_amqp_1_0_str(tvbuff_t *tvb, -+ guint offset, guint bound, guint length, -+ const char **value) -+{ -+ guint string_length; -+ -+ if (length == 1) -+ string_length = tvb_get_guint8(tvb, offset); -+ else if (length == 4) -+ string_length = tvb_get_ntohl(tvb, offset); -+ else { -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid string length size %d!", length); -+ return length; -+ } -+ AMQP_INCREMENT(offset, length, bound); -+ *value = tvb_get_string(tvb, offset, string_length); -+ AMQP_INCREMENT(offset, string_length, bound); -+ return (string_length + length); -+} -+ -+static int -+format_amqp_1_0_symbol(tvbuff_t *tvb, -+ guint offset, guint bound, guint length, -+ const char **value) -+{ -+ guint symbol_length; -+ if (length == 1) -+ symbol_length = tvb_get_guint8(tvb, offset); -+ else if (length == 4) -+ symbol_length = tvb_get_ntohl(tvb, offset); -+ else { -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid symbol length size %d!", length); -+ return length; -+ } -+ AMQP_INCREMENT(offset, length, bound); -+ *value = tvb_get_string(tvb, offset, symbol_length); -+ AMQP_INCREMENT(offset, symbol_length, bound); -+ return (symbol_length + length); -+} -+ -+ - /* AMQP 0-10 Type Decoders */ - - static gboolean -@@ -8563,7 +10712,7 @@ get_amqp_0_10_type_formatter(guint8 code, - table = amqp_0_10_fixed_types; - for (i = 0; table[i].typecode != 0xff; ++i) { - if (table[i].typecode == code) { -- *name = ep_strdup(table[i].amqp_typename); -+ *name = wmem_strdup(wmem_packet_scope(), table[i].amqp_typename); - *formatter = table[i].formatter; - *length_size = table[i].known_size; - return TRUE; -@@ -8595,10 +10744,10 @@ format_amqp_0_10_int(tvbuff_t *tvb, - else if (length == 4) - val = (gint32)tvb_get_ntohl(tvb, offset); - else { -- *value = ep_strdup_printf("Invalid int length %d!", length); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid int length %d!", length); - return length; - } -- *value = ep_strdup_printf("%d", val); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "%d", val); - return length; - } - -@@ -8616,10 +10765,10 @@ format_amqp_0_10_uint(tvbuff_t *tvb, - else if (length == 4) - val = tvb_get_ntohl(tvb, offset); - else { -- *value = ep_strdup_printf("Invalid uint length %d!", length); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid uint length %d!", length); - return length; - } -- *value = ep_strdup_printf("%u", val); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "%u", val); - return length; - } - -@@ -8640,7 +10789,7 @@ format_amqp_0_10_boolean(tvbuff_t *tvb, - guint8 val; - - val = tvb_get_guint8(tvb, offset); -- *value = ep_strdup(val ? "true" : "false"); -+ *value = wmem_strdup(wmem_packet_scope(), val ? "true" : "false"); - return 1; - } - -@@ -8658,7 +10807,7 @@ format_amqp_0_10_vbin(tvbuff_t *tvb, - else if (length == 4) - bin_length = tvb_get_ntohl(tvb, offset); - else { -- *value = ep_strdup_printf("Invalid vbin length size %d!", length); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid vbin length size %d!", length); - return length; - } - AMQP_INCREMENT(offset, length, bound); -@@ -8681,7 +10830,7 @@ format_amqp_0_10_str(tvbuff_t *tvb, - else if (length == 4) - string_length = tvb_get_ntohl(tvb, offset); - else { -- *value = ep_strdup_printf("Invalid string length size %d!", length); -+ *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid string length size %d!", length); - return length; - } - AMQP_INCREMENT(offset, length, bound); -@@ -8730,6 +10879,837 @@ proto_register_amqp(void) - * in 0-10, but there are many separate. - */ - static hf_register_info hf[] = { -+ /* DO NOT CHANGE BELOW hf_amqp_1_0_* VARIABLES ORDERING! -+ * It is crucial for subtypes_for_hf_amqp_1_0 */ -+ {&hf_amqp_1_0_size, { -+ "Length", "amqp.length", -+ FT_UINT32, BASE_DEC, NULL, 0x0, -+ "Length of the frame", HFILL}}, -+ {&hf_amqp_1_0_doff, { -+ "Doff", "amqp.doff", -+ FT_UINT8, BASE_DEC, NULL, 0x0, -+ "Data offset", HFILL}}, -+ {&hf_amqp_1_0_type, { -+ "Type", "amqp.type", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_type), 0x0, -+ "Frame type", HFILL}}, -+ {&hf_amqp_1_0_amqp_performative, { -+ "Performative", "amqp.performative", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_AMQP_performatives), 0x0, -+ "AMQP Performative", HFILL}}, -+ {&hf_amqp_1_0_sasl_method, { -+ "Method", "amqp.sasl.method", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_SASL_methods), 0x0, -+ "SASL Method", HFILL}}, -+ {&hf_amqp_1_0_list, { -+ "list-item", "amqp.list", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "List item", HFILL}}, -+ {&hf_amqp_1_0_map, { -+ "map-item", "amqp.map", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Map item", HFILL}}, -+ {&hf_amqp_1_0_array, { -+ "array-item", "amqp.array", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Array item", HFILL}}, -+ {&hf_amqp_1_0_containerId, { -+ "Container-Id", "amqp.performative.arguments.containerId", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Container ID", HFILL}}, -+ {&hf_amqp_1_0_hostname, { -+ "Hostname", "amqp.performative.arguments.hostname", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ NULL, HFILL}}, -+ {&hf_amqp_1_0_maxFrameSize, { -+ "Max-Frame-Size", "amqp.performative.arguments.maxFrameSize", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Max frame size", HFILL}}, -+ {&hf_amqp_1_0_channelMax, { -+ "Channel-Max", "amqp.performative.arguments.channelMax", -+ FT_UINT16, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Channel max", HFILL}}, -+ {&hf_amqp_1_0_idleTimeOut, { -+ "Idle-Timeout", "amqp.performative.arguments.idleTimeout", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Idle timeout", HFILL}}, -+ {&hf_amqp_1_0_outgoingLocales, { -+ "Outgoing-Locales", "amqp.performative.arguments.outgoingLocales", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Outgoing locales", HFILL}}, -+ {&hf_amqp_1_0_incomingLocales, { -+ "Incoming-Locales", "amqp.performative.arguments.incomingLocales", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Incoming locales", HFILL}}, -+ {&hf_amqp_1_0_offeredCapabilities, { -+ "Offered-Capabilities", "amqp.arguments.offeredCapabilities", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Offered capabilities", HFILL}}, -+ {&hf_amqp_1_0_desiredCapabilities, { -+ "Desired-Capabilities", "amqp.performative.arguments.desiredCapabilities", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Desired capabilities", HFILL}}, -+ {&hf_amqp_1_0_properties, { -+ "Properties", "amqp.performative.arguments.properties", -+ FT_NONE, BASE_NONE, NULL, 0, -+ NULL, HFILL}}, -+ {&hf_amqp_1_0_nextIncomingId, { -+ "Next-Incoming-Id", "amqp.performative.arguments.nextIncomingId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Next incoming id", HFILL}}, -+ {&hf_amqp_1_0_deliveryCount, { -+ "Delivery-Count", "amqp.performative.arguments.deliveryCount", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Delivery count", HFILL}}, -+ {&hf_amqp_1_0_sectionNumber, { -+ "Section-Number", "amqp.received.sectionNumber", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Section number of received message", HFILL}}, -+ {&hf_amqp_1_0_sectionOffset, { -+ "Section-Offset", "amqp.received.sectionOffset", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Section offset of received message", HFILL}}, -+ {&hf_amqp_1_0_deliveryFailed, { -+ "Delivery-Failed", "amqp.modified.deliveryFailed", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Deliver failed", HFILL}}, -+ {&hf_amqp_1_0_undeliverableHere, { -+ "Undeliverable-Here", "amqp.modified.undeliverableHere", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Undeliverable here", HFILL}}, -+ {&hf_amqp_1_0_linkCredit, { -+ "Link-Credit", "amqp.performative.arguments.linkCredit", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Link credit", HFILL}}, -+ {&hf_amqp_1_0_available, { -+ "Available", "amqp.performative.arguments.available", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "The number of available messages", HFILL}}, -+ {&hf_amqp_1_0_drain, { -+ "Drain", "amqp.performative.arguments.drain", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Drain mode", HFILL}}, -+ {&hf_amqp_1_0_echo, { -+ "Echo", "amqp.performative.arguments.echo", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Request state from partner", HFILL}}, -+ {&hf_amqp_1_0_deliveryId, { -+ "Delivery-Id", "amqp.performative.arguments.deliveryId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Delivery id", HFILL}}, -+ {&hf_amqp_1_0_deliveryTag, { -+ "Delivery-Tag", "amqp.performative.arguments.deliveryTag", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Delivery tag", HFILL}}, -+ {&hf_amqp_1_0_messageFormat, { -+ "Message-Format", "amqp.performative.arguments.messageFormat", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Message format", HFILL}}, -+ {&hf_amqp_1_0_settled, { -+ "Settled", "amqp.performative.arguments.settled", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ NULL, HFILL}}, -+ {&hf_amqp_1_0_more, { -+ "More", "amqp.performative.arguments.more", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "The message has more content", HFILL}}, -+ {&hf_amqp_1_0_state, { -+ "State", "amqp.performative.arguments.state", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "State of the delivery at sender", HFILL}}, -+ {&hf_amqp_1_0_resume, { -+ "Resume", "amqp.performative.arguments.resume", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Resumed delivery", HFILL}}, -+ {&hf_amqp_1_0_aborted, { -+ "Aborted", "amqp.performative.arguments.aborted", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Message is aborted", HFILL}}, -+ {&hf_amqp_1_0_batchable, { -+ "Batchable", "amqp.performative.arguments.batchable", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Batchable hint", HFILL}}, -+ {&hf_amqp_1_0_first, { -+ "First", "amqp.performative.arguments.first", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Lower bound of deliveries", HFILL}}, -+ {&hf_amqp_1_0_last, { -+ "Last", "amqp.performative.arguments.last", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Upper bound of deliveries", HFILL}}, -+ {&hf_amqp_1_0_closed, { -+ "Closed", "amqp.performative.arguments.closed", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Sender closed the link", HFILL}}, -+ {&hf_amqp_1_0_remoteChannel, { -+ "Remote-Channel", "amqp.performative.arguments.remoteChannel", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Remote Channel", HFILL}}, -+ {&hf_amqp_1_0_nextOutgoingId, { -+ "Next-Outgoing-Id", "amqp.performative.arguments.nextOutgoingId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Next outgoing id", HFILL}}, -+ {&hf_amqp_1_0_incomingWindow, { -+ "Incoming-Window", "amqp.performative.arguments.incomingWindow", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Incoming window", HFILL}}, -+ {&hf_amqp_1_0_outgoingWindow, { -+ "Outgoing-Window", "amqp.performative.arguments.outgoingWindow", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Outgoing window", HFILL}}, -+ {&hf_amqp_1_0_handleMax, { -+ "Handle-Max", "amqp.performative.arguments.handleMax", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Handle max", HFILL}}, -+ {&hf_amqp_1_0_name, { -+ "Name", "amqp.performative.arguments.name", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Name of the link", HFILL}}, -+ {&hf_amqp_1_0_handle, { -+ "Handle", "amqp.performative.arguments.handle", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Handle for the link while attached", HFILL}}, -+ {&hf_amqp_1_0_role, { -+ "Role", "amqp.performative.arguments.role", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_role_value), 0, -+ "Role of the link endpoint", HFILL}}, -+ {&hf_amqp_1_0_sndSettleMode, { -+ "Send-Settle-Mode", "amqp.performative.arguments.sndSettleMode", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Send settle mode", HFILL}}, -+ {&hf_amqp_1_0_rcvSettleMode, { -+ "Receive-Settle-Mode", "amqp.performative.arguments.rcvSettleMode", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Receive settle mode", HFILL}}, -+ {&hf_amqp_1_0_source, { -+ "Source", "amqp.performative.arguments.source", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Source for messages", HFILL}}, -+ {&hf_amqp_1_0_target, { -+ "Target", "amqp.performative.arguments.target", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Target for messages", HFILL}}, -+ {&hf_amqp_1_0_deleteOnClose, { -+ "Delete-On-Close", "amqp.lifetime-policy.deleteOnClose", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Delete on close", HFILL}}, -+ {&hf_amqp_1_0_deleteOnNoLinks, { -+ "Delete-On-No-Links", "amqp.lifetime-policy.deleteOnNoLinks", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Delete on no links", HFILL}}, -+ {&hf_amqp_1_0_deleteOnNoMessages, { -+ "Delete-On-No-Messages", "amqp.lifetime-policy.deleteOnNoMessages", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Delete on no messages", HFILL}}, -+ {&hf_amqp_1_0_deleteOnNoLinksOrMessages, { -+ "Delete-On-No-Links-Or-Messages", "amqp.lifetime-policy.deleteOnNoLinksOrMessages", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Delete on no links or messages", HFILL}}, -+ {&hf_amqp_1_0_coordinator, { -+ "Coordinator", "amqp.tx.coordinator", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Transaction coordinator", HFILL}}, -+ {&hf_amqp_1_0_declare, { -+ "Declare", "amqp.tx.declare", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Declare transaction", HFILL}}, -+ {&hf_amqp_1_0_globalId, { -+ "Global-Id", "amqp.tx.arguments.globalId", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Global id of a transaction", HFILL}}, -+ {&hf_amqp_1_0_discharge, { -+ "Discharge", "amqp.tx.discharge", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Discharge transaction", HFILL}}, -+ {&hf_amqp_1_0_txnId, { -+ "Txn-Id", "amqp.tx.arguments.txnId", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "Transaction id", HFILL}}, -+ {&hf_amqp_1_0_fail, { -+ "Fail", "amqp.tx.arguments.fail", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Fail flag of transaction", HFILL}}, -+ {&hf_amqp_1_0_declared, { -+ "Declared", "amqp.tx.declared", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Declared transaction", HFILL}}, -+ {&hf_amqp_1_0_transactionalState, { -+ "Transactional-State", "amqp.tx.transactionalState", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Transactional state", HFILL}}, -+ {&hf_amqp_1_0_outcome, { -+ "Outcome", "amqp.tx.arguments.outcome", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Outcome of transaction", HFILL}}, -+ {&hf_amqp_1_0_unsettled, { -+ "Unsettled", "amqp.performative.arguments.unsettled", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Unsettled delivery state", HFILL}}, -+ {&hf_amqp_1_0_incompleteUnsettled, { -+ "Incomplete-Unsettled", "amqp.performative.arguments.incompleteUnsettled", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Incomplete unsettled", HFILL}}, -+ {&hf_amqp_1_0_initialDeliveryCount, { -+ "Initial-Delivery-Count", "amqp.performative.arguments.initDeliveryCount", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Initial delivery count", HFILL}}, -+ {&hf_amqp_1_0_maxMessageSize, { -+ "Max-Message-Size", "amqp.performative.arguments.maxMessageSize", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Max message size", HFILL}}, -+ {&hf_amqp_1_0_error, { -+ "Error", "amqp.performative.arguments.error", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Error in a performative", HFILL}}, -+ {&hf_amqp_1_0_messageHeader, { -+ "Message-Header", "amqp.header", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Message header", HFILL}}, -+ {&hf_amqp_1_0_messageProperties, { -+ "Message-Properties", "amqp.properties", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Message properties", HFILL}}, -+ {&hf_amqp_1_0_deliveryAnnotations, { -+ "Delivery-Annotations", "amqp.deliveryAnnotations", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Delivery annotations", HFILL}}, -+ {&hf_amqp_1_0_messageAnnotations, { -+ "Message-Annotations", "amqp.messageAnnotations", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Message annotations", HFILL}}, -+ {&hf_amqp_1_0_applicationProperties, { -+ "Application-Properties", "amqp.applicationProperties", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Application properties", HFILL}}, -+ {&hf_amqp_1_0_data, { -+ "Data", "amqp.data", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "Opaque binary data", HFILL}}, -+ {&hf_amqp_1_0_amqp_sequence, { -+ "AMQP-Sequence", "amqp.amqp_sequence", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "AMQP sequence", HFILL}}, -+ {&hf_amqp_1_0_amqp_value, { -+ "AMQP-Value", "amqp.amqp_value", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "AMQP value", HFILL}}, -+ {&hf_amqp_1_0_footer, { -+ "Footer", "amqp.footer", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Message footer", HFILL}}, -+ {&hf_amqp_1_0_received, { -+ "Received", "amqp.delivery-state.received", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Received messages", HFILL}}, -+ {&hf_amqp_1_0_accepted, { -+ "Accepted", "amqp.delivery-state.accepted", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Accepted messages", HFILL}}, -+ {&hf_amqp_1_0_rejected, { -+ "Rejected", "amqp.delivery-state.rejected", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Rejected messages", HFILL}}, -+ {&hf_amqp_1_0_released, { -+ "Released", "amqp.delivery-state.released", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Released messages", HFILL}}, -+ {&hf_amqp_1_0_modified, { -+ "Modified", "amqp.delivery-state.modified", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Modified messages", HFILL}}, -+ {&hf_amqp_1_0_condition, { -+ "Condition", "amqp.error.condition", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Error condition", HFILL}}, -+ {&hf_amqp_1_0_description, { -+ "Description", "amqp.error.description", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Error description", HFILL}}, -+ {&hf_amqp_1_0_info, { -+ "Info", "amqp.error.info", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Error info", HFILL}}, -+ {&hf_amqp_1_0_address, { -+ "Address", "amqp.performative.arguments.address", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Address of a node", HFILL}}, -+ {&hf_amqp_1_0_durable, { -+ "Durable", "amqp.message.durable", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Message durability", HFILL}}, -+ {&hf_amqp_1_0_terminusDurable, { -+ "Terminus-Durable", "amqp.performative.arguments.terminusDurable", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Terminus durability", HFILL}}, -+ {&hf_amqp_1_0_priority, { -+ "Priority", "amqp.message.priority", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Message priority", HFILL}}, -+ {&hf_amqp_1_0_ttl, { -+ "Ttl", "amqp.message.ttl", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Time to live", HFILL}}, -+ {&hf_amqp_1_0_firstAcquirer, { -+ "First-Acquirer", "amqp.message.firstAcquirer", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "First acquirer", HFILL}}, -+ {&hf_amqp_1_0_expiryPolicy, { -+ "Expiry-Policy", "amqp.properties.expiryPolicy", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Expiry policy", HFILL}}, -+ {&hf_amqp_1_0_timeout, { -+ "Timeout", "amqp.properties.timeout", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Duration that an expiring target will be retained", HFILL}}, -+ {&hf_amqp_1_0_dynamic, { -+ "Dynamic", "amqp.properties.dynamic", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Dynamic creation of a remote node", HFILL}}, -+ {&hf_amqp_1_0_dynamicNodeProperties, { -+ "Dynamic-Node-Properties", "amqp.properties.dynamicNodeProperties", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Dynamic node properties", HFILL}}, -+ {&hf_amqp_1_0_distributionMode, { -+ "Distribution-Mode", "amqp.properties.distributionMode", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Distribution mode", HFILL}}, -+ {&hf_amqp_1_0_filter, { -+ "Filter", "amqp.properties.filter", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Predicates to filter messages admitted to the link", HFILL}}, -+ {&hf_amqp_1_0_defaultOutcome, { -+ "Default-Outcome", "amqp.properties.defaultOutcome", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Default outcome", HFILL}}, -+ {&hf_amqp_1_0_outcomes, { -+ "Outcomes", "amqp.properties.outcomes", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Outcomes descriptors for the link", HFILL}}, -+ {&hf_amqp_1_0_capabilities, { -+ "Capabilities", "amqp.properties.capabilities", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Extension capabilities of the sender", HFILL}}, -+ {&hf_amqp_1_0_messageId, { -+ "Message-Id", "amqp.message.messageId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Message id", HFILL}}, -+ {&hf_amqp_1_0_userId, { -+ "User-Id", "amqp.message.userId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "User id", HFILL}}, -+ {&hf_amqp_1_0_to, { -+ "To", "amqp.message.to", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Destination address of the message", HFILL}}, -+ {&hf_amqp_1_0_subject, { -+ "Subject", "amqp.message.subject", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Message subject", HFILL}}, -+ {&hf_amqp_1_0_replyTo, { -+ "Reply-To", "amqp.message.replyTo", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Reply to", HFILL}}, -+ {&hf_amqp_1_0_correlationId, { -+ "Correlation-Id", "amqp.message.correlationId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Correlation id", HFILL}}, -+ {&hf_amqp_1_0_contentType, { -+ "Content-Type", "amqp.message.contentType", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Content type", HFILL}}, -+ {&hf_amqp_1_0_contentEncoding, { -+ "Content-Encoding", "amqp.message.contentEncoding", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Content encoding", HFILL}}, -+ {&hf_amqp_1_0_absoluteExpiryTime, { -+ "Expiry-Time", "amqp.message.expiryTime", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Absolute expiry time", HFILL}}, -+ {&hf_amqp_1_0_creationTime, { -+ "Creation-Time", "amqp.message.creationTime", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Creation time", HFILL}}, -+ {&hf_amqp_1_0_groupId, { -+ "Group-Id", "amqp.message.groupId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Croup id", HFILL}}, -+ {&hf_amqp_1_0_groupSequence, { -+ "Group-Sequence", "amqp.message.groupSequence", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Group sequence", HFILL}}, -+ {&hf_amqp_1_0_replyToGroupId, { -+ "Reply-To-Group-Id", "amqp.message.replyToGroupId", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Reply to group id", HFILL}}, -+ {&hf_amqp_1_0_mechanisms, { -+ "Mechanisms", "amqp.sasl.mechanisms", -+ FT_NONE, BASE_NONE, NULL, 0, -+ "Supported security mechanisms", HFILL}}, -+ {&hf_amqp_1_0_mechanism, { -+ "Mechanism", "amqp.sasl.mechanism", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Chosen security mechanism", HFILL}}, -+ {&hf_amqp_1_0_initResponse, { -+ "Init-Response", "amqp.sasl.initResponse", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "Initial response", HFILL}}, -+ {&hf_amqp_1_0_saslChallenge, { -+ "Challenge", "amqp.sasl.challenge", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "SASL challenge", HFILL}}, -+ {&hf_amqp_1_0_saslResponse, { -+ "Response", "amqp.sasl.response", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "SASL response", HFILL}}, -+ {&hf_amqp_1_0_saslCode, { -+ "Code", "amqp.sasl.saslCode", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_SASL_code_value), 0, -+ "SASL outcome code", HFILL}}, -+ {&hf_amqp_1_0_saslAdditionalData, { -+ "Additional-Data", "amqp.sasl.addData", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_encoding_width0), 0, -+ "SASL outcome additional data", HFILL}}, -+ /* further hf_amqp_1_0_* can be re-ordered if required; */ -+ {&hf_amqp_1_0_hostname_str, { -+ "Hostname", "amqp.performative.arguments.hostname", -+ FT_STRING, BASE_NONE, NULL, 0, -+ NULL, HFILL}}, -+ {&hf_amqp_1_0_maxFrameSize_1, { -+ "Max-Frame-Size", "amqp.performative.arguments.maxFrameSize", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Max frame size", HFILL}}, -+ {&hf_amqp_1_0_maxFrameSize_4, { -+ "Max-Frame-Size", "amqp.performative.arguments.maxFrameSize", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Max frame size", HFILL}}, -+ {&hf_amqp_1_0_incomingWindow_1, { -+ "Incoming-Window", "amqp.performative.arguments.incomingWindow", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Incoming window", HFILL}}, -+ {&hf_amqp_1_0_incomingWindow_4, { -+ "Incoming-Window", "amqp.performative.arguments.incomingWindow", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Incoming window", HFILL}}, -+ {&hf_amqp_1_0_outgoingWindow_1, { -+ "Outgoing-Window", "amqp.performative.arguments.outgoingWindow", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Outgoing window", HFILL}}, -+ {&hf_amqp_1_0_outgoingWindow_4, { -+ "Outgoing-Window", "amqp.performative.arguments.outgoingWindow", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Outgoing window", HFILL}}, -+ {&hf_amqp_1_0_linkCredit_1, { -+ "Link-Credit", "amqp.performative.arguments.linkCredit", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Link credit", HFILL}}, -+ {&hf_amqp_1_0_linkCredit_4, { -+ "Link-Credit", "amqp.performative.arguments.linkCredit", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Link credit", HFILL}}, -+ {&hf_amqp_1_0_available_1, { -+ "Available", "amqp.performative.arguments.available", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "The number of available messages", HFILL}}, -+ {&hf_amqp_1_0_available_4, { -+ "Available", "amqp.performative.arguments.available", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "The number of available messages", HFILL}}, -+ {&hf_amqp_1_0_deliveryCount_1, { -+ "Delivery-Count", "amqp.performative.arguments.deliveryCount", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Delivery count", HFILL}}, -+ {&hf_amqp_1_0_deliveryCount_4, { -+ "Delivery-Count", "amqp.performative.arguments.deliveryCount", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Delivery count", HFILL}}, -+ {&hf_amqp_1_0_sectionNumber_1, { -+ "Section-Number", "amqp.received.sectionNumber", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Section number of received message", HFILL}}, -+ {&hf_amqp_1_0_sectionNumber_4, { -+ "Section-Number", "amqp.received.sectionNumber", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Section number of received message", HFILL}}, -+ {&hf_amqp_1_0_idleTimeOut_1, { -+ "Idle-Timeout", "amqp.performative.arguments.idleTimeout", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Idle timeout", HFILL}}, -+ {&hf_amqp_1_0_idleTimeOut_4, { -+ "Idle-Timeout", "amqp.performative.arguments.idleTimeout", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Idle timeout", HFILL}}, -+ {&hf_amqp_1_0_outgoingLocales_sym, { -+ "Outgoing-Locales", "amqp.performative.arguments.outgoingLocales", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Outgoing locales", HFILL}}, -+ {&hf_amqp_1_0_incomingLocales_sym, { -+ "Incoming-Locales", "amqp.performative.arguments.incomingLocales", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Incoming locales", HFILL}}, -+ {&hf_amqp_1_0_offeredCapabilities_sym, { -+ "Offered-Capabilities", "amqp.arguments.offeredCapabilities", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Offered capabilities", HFILL}}, -+ {&hf_amqp_1_0_desiredCapabilities_sym, { -+ "Desired-Capabilities", "amqp.performative.arguments.desiredCapabilities", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Desired capabilities", HFILL}}, -+ {&hf_amqp_1_0_nextIncomingId_1, { -+ "Next-Incoming-Id", "amqp.performative.arguments.nextIncomingId", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Next incoming id", HFILL}}, -+ {&hf_amqp_1_0_nextIncomingId_4, { -+ "Next-Incoming-Id", "amqp.performative.arguments.nextIncomingId", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Next incoming id", HFILL}}, -+ {&hf_amqp_1_0_sectionOffset_1, { -+ "Section-Offset", "amqp.received.sectionOffset", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Section offset of received message", HFILL}}, -+ {&hf_amqp_1_0_sectionOffset_8, { -+ "Section-Offset", "amqp.received.sectionOffset", -+ FT_UINT64, BASE_DEC, NULL, 0, -+ "Section offset of received message", HFILL}}, -+ {&hf_amqp_1_0_maxMessageSize_1, { -+ "Max-Message-Size", "amqp.performative.arguments.maxMessageSize", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Max message size", HFILL}}, -+ {&hf_amqp_1_0_maxMessageSize_8, { -+ "Max-Message-Size", "amqp.performative.arguments.maxMessageSize", -+ FT_UINT64, BASE_DEC, NULL, 0, -+ "Max message size", HFILL}}, -+ {&hf_amqp_1_0_nextOutgoingId_1, { -+ "Next-Outgoing-Id", "amqp.performative.arguments.nextOutgoingId", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Next outgoing id", HFILL}}, -+ {&hf_amqp_1_0_nextOutgoingId_4, { -+ "Next-Outgoing-Id", "amqp.performative.arguments.nextOutgoingId", -+ FT_UINT16, BASE_DEC, NULL, 0, -+ "Next outgoing id", HFILL}}, -+ {&hf_amqp_1_0_deliveryId_1, { -+ "Delivery-Id", "amqp.performative.arguments.deliveryId", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Delivery id", HFILL}}, -+ {&hf_amqp_1_0_deliveryId_4, { -+ "Delivery-Id", "amqp.performative.arguments.deliveryId", -+ FT_UINT16, BASE_DEC, 0, 0, -+ "Delivery id", HFILL}}, -+ {&hf_amqp_1_0_deliveryTag_bin, { -+ "Delivery-Tag", "amqp.performative.arguments.deliveryTag", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "Delivery tag", HFILL}}, -+ {&hf_amqp_1_0_messageFormat_1, { -+ "Message-Format", "amqp.performative.arguments.messageFormat", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Message format", HFILL}}, -+ {&hf_amqp_1_0_messageFormat_4, { -+ "Message-Format", "amqp.performative.arguments.messageFormat", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Message format", HFILL}}, -+ {&hf_amqp_1_0_first_1, { -+ "First", "amqp.performative.arguments.first", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Lower bound of deliveries", HFILL}}, -+ {&hf_amqp_1_0_first_4, { -+ "First", "amqp.performative.arguments.first", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Lower bound of deliveries", HFILL}}, -+ {&hf_amqp_1_0_last_1, { -+ "Last", "amqp.performative.arguments.last", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Upper bound of deliveries", HFILL}}, -+ {&hf_amqp_1_0_last_4, { -+ "Last", "amqp.performative.arguments.last", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Upper bound of deliveries", HFILL}}, -+ {&hf_amqp_1_0_remoteChannel_2, { -+ "Remote-Channel", "amqp.performative.arguments.remoteChannel", -+ FT_UINT16, BASE_DEC, NULL, 0, -+ "Remote Channel", HFILL}}, -+ {&hf_amqp_1_0_handleMax_1, { -+ "Handle-Max", "amqp.performative.arguments.handleMax", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Handle max", HFILL}}, -+ {&hf_amqp_1_0_handleMax_4, { -+ "Handle-Max", "amqp.performative.arguments.handleMax", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Handle max", HFILL}}, -+ {&hf_amqp_1_0_handle_1, { -+ "Handle", "amqp.performative.arguments.handle", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Handle for the link while attached", HFILL}}, -+ {&hf_amqp_1_0_handle_4, { -+ "Handle", "amqp.performative.arguments.handle", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Handle for the link while attached", HFILL}}, -+ {&hf_amqp_1_0_sndSettleMode_1, { -+ "Send-Settle-Mode", "amqp.performative.arguments.sndSettleMode", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_sndSettleMode_value), 0, -+ "Send settle mode", HFILL}}, -+ {&hf_amqp_1_0_rcvSettleMode_1, { -+ "Receive-Settle-Mode", "amqp.performative.arguments.rcvSettleMode", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_rcvSettleMode_value), 0, -+ "Receive settle mode", HFILL}}, -+ {&hf_amqp_1_0_initialDeliveryCount_1, { -+ "Initial-Delivery-Count", "amqp.performative.arguments.initDeliveryCount", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Initial delivery count", HFILL}}, -+ {&hf_amqp_1_0_initialDeliveryCount_4, { -+ "Initial-Delivery-Count", "amqp.performative.arguments.initDeliveryCount", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Initial delivery count", HFILL}}, -+ {&hf_amqp_1_0_description_str, { -+ "Description", "amqp.error.description", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Error description", HFILL}}, -+ {&hf_amqp_1_0_address_str, { -+ "Address", "amqp.performative.arguments.address", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Address of a node", HFILL}}, -+ {&hf_amqp_1_0_terminusDurable_1, { -+ "Terminus-Durable", "amqp.performative.arguments.terminusDurable", -+ FT_UINT8, BASE_DEC, VALS(amqp_1_0_durable_value), 0, -+ "Terminus durability", HFILL}}, -+ {&hf_amqp_1_0_terminusDurable_4, { -+ "Terminus-Durable", "amqp.performative.arguments.terminusDurable", -+ FT_UINT32, BASE_DEC, VALS(amqp_1_0_durable_value), 0, -+ "Terminus durability", HFILL}}, -+ {&hf_amqp_1_0_priority_1, { -+ "Priority", "amqp.message.priority", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Message priority", HFILL}}, -+ {&hf_amqp_1_0_ttl_1, { -+ "Ttl", "amqp.message.ttl", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Time to live", HFILL}}, -+ {&hf_amqp_1_0_ttl_4, { -+ "Ttl", "amqp.message.ttl", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Time to live", HFILL}}, -+ {&hf_amqp_1_0_expiryPolicy_sym, { -+ "Expiry-Policy", "amqp.properties.expiryPolicy", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Expiry policy", HFILL}}, -+ {&hf_amqp_1_0_timeout_1, { -+ "Timeout", "amqp.properties.timeout", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Duration that an expiring target will be retained", HFILL}}, -+ {&hf_amqp_1_0_timeout_4, { -+ "Timeout", "amqp.properties.timeout", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Duration that an expiring target will be retained", HFILL}}, -+ {&hf_amqp_1_0_distributionMode_sym, { -+ "Distribution-Mode", "amqp.properties.distributionMode", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Distribution mode", HFILL}}, -+ {&hf_amqp_1_0_outcomes_sym, { -+ "Outcomes", "amqp.properties.outcomes", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Outcomes descriptors for the link", HFILL}}, -+ {&hf_amqp_1_0_capabilities_sym, { -+ "Capabilities", "amqp.properties.capabilities", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Extension capabilities of the sender", HFILL}}, -+ {&hf_amqp_1_0_messageId_1, { -+ "Message-Id", "amqp.message.messageId", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Message id", HFILL}}, -+ {&hf_amqp_1_0_messageId_str, { -+ "Message-Id", "amqp.message.messageId", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Message id", HFILL}}, -+ {&hf_amqp_1_0_messageId_bin, { -+ "Message-Id", "amqp.message.messageId", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "Message id", HFILL}}, -+ {&hf_amqp_1_0_messageId_uuid, { -+ "Message-Id", "amqp.message.messageId", -+ FT_GUID, BASE_NONE, NULL, 0, -+ "Message id", HFILL}}, -+ {&hf_amqp_1_0_messageId_8, { -+ "Message-Id", "amqp.message.messageId", -+ FT_UINT64, BASE_DEC, NULL, 0, -+ "Message id", HFILL}}, -+ {&hf_amqp_1_0_correlationId_1, { -+ "Correlation-Id", "amqp.message.correlationId", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Correlation id", HFILL}}, -+ {&hf_amqp_1_0_correlationId_str, { -+ "Correlation-Id", "amqp.message.correlationId", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Correlation id", HFILL}}, -+ {&hf_amqp_1_0_correlationId_bin, { -+ "Correlation-Id", "amqp.message.correlationId", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "Correlation id", HFILL}}, -+ {&hf_amqp_1_0_correlationId_uuid, { -+ "Correlation-Id", "amqp.message.correlationId", -+ FT_GUID, BASE_NONE, NULL, 0, -+ "Correlation id", HFILL}}, -+ {&hf_amqp_1_0_correlationId_8, { -+ "Correlation-Id", "amqp.message.correlationId", -+ FT_UINT64, BASE_DEC, NULL, 0, -+ "Correlation id", HFILL}}, -+ {&hf_amqp_1_0_userId_bin, { -+ "User-Id", "amqp.message.userId", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "User id", HFILL}}, -+ {&hf_amqp_1_0_to_str, { -+ "To", "amqp.message.to", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Destination address of the message", HFILL}}, -+ {&hf_amqp_1_0_subject_str, { -+ "Subject", "amqp.message.subject", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Message subject", HFILL}}, -+ {&hf_amqp_1_0_replyTo_str, { -+ "Reply-To", "amqp.message.replyTo", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Reply to", HFILL}}, -+ {&hf_amqp_1_0_contentType_sym, { -+ "Content-Type", "amqp.message.contentType", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Content type", HFILL}}, -+ {&hf_amqp_1_0_contentEncoding_sym, { -+ "Content-Encoding", "amqp.message.contentEncoding", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Content encoding", HFILL}}, -+ {&hf_amqp_1_0_absoluteExpiryTime_timestamp, { -+ "Expiry-Time", "amqp.message.expiryTime", -+ FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, -+ "Absolute expiry time", HFILL}}, -+ {&hf_amqp_1_0_creationTime_timestamp, { -+ "Creation-Time", "amqp.message.creationTime", -+ FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, -+ "Creation time", HFILL}}, -+ {&hf_amqp_1_0_groupId_str, { -+ "Group-Id", "amqp.message.groupId", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Croup id", HFILL}}, -+ {&hf_amqp_1_0_groupSequence_1, { -+ "Group-Sequence", "amqp.message.groupSequence", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Group sequence", HFILL}}, -+ {&hf_amqp_1_0_groupSequence_4, { -+ "Group-Sequence", "amqp.message.groupSequence", -+ FT_UINT32, BASE_DEC, NULL, 0, -+ "Group sequence", HFILL}}, -+ {&hf_amqp_1_0_replyToGroupId_str, { -+ "Reply-To-Group-Id", "amqp.message.replyToGroupId", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Reply to group id", HFILL}}, -+ {&hf_amqp_1_0_mechanisms_sym, { -+ "Mechanisms", "amqp.sasl.mechanisms", -+ FT_STRING, BASE_NONE, NULL, 0, -+ "Supported security mechanisms", HFILL}}, -+ {&hf_amqp_1_0_initResponse_bin, { -+ "Init-Response", "amqp.sasl.initResponse", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "Initial response", HFILL}}, -+ {&hf_amqp_1_0_saslAdditionalData_bin, { -+ "Additional-Data", "amqp.sasl.addData", -+ FT_BYTES, BASE_NONE, NULL, 0, -+ "SASL outcome additional data", HFILL}}, - {&hf_amqp_0_10_format, { - "Format", "amqp.format", - FT_UINT8, BASE_DEC, NULL, 0xc0, -@@ -10575,6 +13555,10 @@ proto_register_amqp(void) - "Protocol ID Minor", "amqp.init.id_minor", - FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL}}, -+ {&hf_amqp_init_id, { -+ "Protocol-ID", "amqp.init.id", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ NULL, HFILL}}, - {&hf_amqp_init_version_major, { - "Version Major", "amqp.init.version_major", - FT_UINT8, BASE_DEC, NULL, 0, -@@ -10582,7 +13566,11 @@ proto_register_amqp(void) - {&hf_amqp_init_version_minor, { - "Version Minor", "amqp.init.version_minor", - FT_UINT8, BASE_DEC, NULL, 0, -- "Protocol version minor", HFILL}} -+ "Protocol version minor", HFILL}}, -+ {&hf_amqp_init_version_revision, { -+ "Version-Revision", "amqp.init.version_revision", -+ FT_UINT8, BASE_DEC, NULL, 0, -+ "Protocol version revision", HFILL}} - }; - - /* Setup of protocol subtree array */ -@@ -10595,7 +13583,10 @@ proto_register_amqp(void) - &ett_field_table, - &ett_amqp_init, - &ett_amqp_0_10_map, -- &ett_amqp_0_10_array -+ &ett_amqp_0_10_array, -+ &ett_amqp_1_0_array, -+ &ett_amqp_1_0_map, -+ &ett_amqp_1_0_list - }; - - proto_amqp = proto_register_protocol( -diff --git a/epan/wmem/wmem_strbuf.h b/epan/wmem/wmem_strbuf.h -index 8c4491b..d4cea3e 100644 ---- a/epan/wmem/wmem_strbuf.h -+++ b/epan/wmem/wmem_strbuf.h -@@ -44,6 +44,9 @@ wmem_strbuf_t * - wmem_strbuf_sized_new(wmem_allocator_t *allocator, - gsize alloc_len, gsize max_len); - -+#define wmem_strbuf_new_label(ALLOCATOR) \ -+ wmem_strbuf_sized_new((ALLOCATOR), 0, ITEM_LABEL_LENGTH) -+ - WS_DLL_PUBLIC - wmem_strbuf_t * - wmem_strbuf_new(wmem_allocator_t *allocator, const gchar *str); diff --git a/wireshark.spec b/wireshark.spec index 1a9defb..4ec063d 100644 --- a/wireshark.spec +++ b/wireshark.spec @@ -20,7 +20,7 @@ Summary: Network traffic analyzer Name: wireshark -Version: 1.10.9 +Version: 1.12.0 Release: 1%{?dist} License: GPL+ Group: Applications/Internet @@ -30,56 +30,20 @@ Source1: 90-wireshark-usbmon.rules Patch1: wireshark-0001-enable-Lua-support.patch # Fedora-specific Patch2: wireshark-0002-Customize-permission-denied-error.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch3: wireshark-0003-Load-correct-shared-object-name-in-python.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch4: wireshark-0004-fix-documentation-build-error.patch # Will be proposed upstream -Patch5: wireshark-0005-fix-string-overrun-in-plugins-profinet.patch -# Backported from upstream. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8326 -Patch6: wireshark-0006-From-Peter-Lemenkov-via-https-bugs.wireshark.org-bug.patch -# Backported from upstream. See also https://bugzilla.redhat.com/1007139 -Patch7: wireshark-0007-The-beginning-of-an-openflow-dissector.patch +Patch3: wireshark-0003-fix-string-overrun-in-plugins-profinet.patch # Will be proposed upstream -Patch8: wireshark-0008-adds-autoconf-macro-file.patch +Patch4: wireshark-0004-adds-autoconf-macro-file.patch # Fedora-specific -Patch9: wireshark-0009-Restore-Fedora-specific-groups.patch +Patch5: wireshark-0005-Restore-Fedora-specific-groups.patch # Will be proposed upstream -Patch10: wireshark-0010-Add-pkgconfig-entry.patch +Patch6: wireshark-0006-Add-pkgconfig-entry.patch # Will be proposed upstream -Patch11: wireshark-0011-Install-autoconf-related-file.patch +Patch7: wireshark-0007-Install-autoconf-related-file.patch # Fedora-specific -Patch12: wireshark-0012-move-default-temporary-directory-to-var-tmp.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch13: wireshark-0013-Copy-over-r49999-from-trunk.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch14: wireshark-0014-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch15: wireshark-0015-From-Dirk-Jagdmann-Make-sure-err_str-is-initialized.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch16: wireshark-0016-Crash-when-selecting-Decode-As-based-on-SCTP-PPID.-B.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch17: wireshark-0017-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch18: wireshark-0018-Copy-over-from-Trunk.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch19: wireshark-0019-Bugfix-port-number-endianness.-Bug-9530-https-bugs.w.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch20: wireshark-0020-Something-went-wrong-with-the-backport-of-r53608-r53.patch -# Applied upstream: -# https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9576 -Patch21: wireshark-0021-Remove-g_memmove.patch -# W.i.p. patch. See also: -# https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9561 -Patch22: wireshark-0022-Fix-IP-types.patch -# No longer necessary - will be removed in the next release (1.12.x) -Patch23: wireshark-0023-Copy-over-r54544-from-trunk.patch +Patch8: wireshark-0008-move-default-temporary-directory-to-var-tmp.patch # Fedora-specific -Patch24: wireshark-0024-Fix-paths-in-a-wireshark.desktop-file.patch -# Fedora-specific -Patch25: wireshark-0025-Fix-Capture-Dialog-layout.patch -# Applied upstream (unstable branch) -Patch26: wireshark-0026-amqp-1.0.patch +Patch9: wireshark-0009-Fix-paths-in-a-wireshark.desktop-file.patch Url: http://www.wireshark.org/ BuildRequires: libpcap-devel >= 0.9 @@ -176,30 +140,30 @@ and plugins. %endif %patch2 -p1 -b .perm_denied_customization -#%patch3 -p1 -b .soname -#%patch4 -p1 -b .pod2man -%patch5 -p1 -b .profinet_crash -%patch6 -p1 -b .rtpproxy -%patch7 -p1 -b .openflow -%patch8 -p1 -b .add_autoconf -%patch9 -p1 -b .restore_group -%patch10 -p1 -b .add_pkgconfig -%patch11 -p1 -b .install_autoconf -%patch12 -p1 -b .tmp_dir -#%patch13 -p1 -b .allow_64kpackets_for_usb -#%patch14 -p1 -b .dont_die_during_sip_dissection -#%patch15 -p1 -b .fix_main_window -#%patch16 -p1 -b .fix_sctp -#%patch17 -p1 -b .fix_global_pinfo -#%patch18 -p1 -b .fix_overflow -#%patch19 -p1 -b .fix_endianness -#%patch20 -p1 -b .fix_previous_backport -%patch21 -p1 -b .remove_g_memmove -%patch22 -p1 -b .rtpproxy_ip_types -#%patch23 -p1 -b .rare_bug_with_sniffer_traces -%patch24 -p1 -b .fix_paths -%patch25 -p1 -b .fix_capture_dlg_layout -%patch26 -p1 -b .amqp-1.0 +%patch3 -p1 -b .profinet_crash +%patch4 -p1 -b .add_autoconf +%patch5 -p1 -b .restore_group + +# Somebody forgot to add this file into tarball (fixed in wireshark-1.12.1) +echo "prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=\${prefix} +libdir=\${prefix}/@CMAKE_INSTALL_LIBDIR@ +sharedlibdir=\${libdir} +includedir=\${prefix}/include/wireshark +plugindir=@PLUGIN_INSTALL_DIR@ + +Name: wireshark +Description: wireshark network packet dissection library +Version: @PROJECT_VERSION@ + +Requires: +Libs: -L\${libdir} -L\${sharedlibdir} -lwireshark +Cflags: -I\${includedir}" > wireshark.pc.in + +%patch6 -p1 -b .add_pkgconfig +%patch7 -p1 -b .install_autoconf +%patch8 -p1 -b .tmp_dir +%patch9 -p1 -b .fix_paths %build %ifarch s390 s390x sparcv9 sparc64 @@ -222,6 +186,7 @@ autoreconf -ivf --with-gnu-ld \ --with-pic \ %if %{with_gtk2} + --with-gtk2 \ --with-gtk3=no \ %else --with-gtk3=yes \ @@ -249,8 +214,6 @@ autoreconf -ivf --with-ssl \ --disable-warnings-as-errors \ --with-plugins=%{_libdir}/%{name}/plugins/%{version} \ - --with-dumpcap-group="wireshark" \ - --enable-setcap-install \ --enable-airpcap #remove rpath @@ -285,8 +248,6 @@ mkdir -p "${IDIR}/wsutil" mkdir -p %{buildroot}/%{_sysconfdir}/udev/rules.d install -m 644 color.h config.h register.h "${IDIR}/" install -m 644 cfile.h file.h "${IDIR}/" -install -m 644 frame_data_sequence.h "${IDIR}/" -install -m 644 packet-range.h print.h "${IDIR}/" install -m 644 epan/*.h "${IDIR}/epan/" install -m 644 epan/crypt/*.h "${IDIR}/epan/crypt" install -m 644 epan/ftypes/*.h "${IDIR}/epan/ftypes" @@ -342,6 +303,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_sbindir}/text2pcap %{_sbindir}/dftest %{_sbindir}/capinfos +%{_sbindir}/captype %{_sbindir}/randpkt %{_sbindir}/reordercap %attr(0750, root, wireshark) %caps(cap_net_raw,cap_net_admin=ep) %{_sbindir}/dumpcap @@ -383,6 +345,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/icons/hicolor/64x64/mimetypes/application-wireshark-doc.png %{_datadir}/icons/hicolor/128x128/mimetypes/application-wireshark-doc.png %{_datadir}/icons/hicolor/256x256/mimetypes/application-wireshark-doc.png +%{_datadir}/icons/hicolor/scalable/apps/wireshark.svg %{_datadir}/mime/packages/wireshark.xml %{_sbindir}/wireshark %{_mandir}/man1/wireshark.* @@ -398,6 +361,17 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/aclocal/* %changelog +* Tue Aug 05 2014 Peter Lemenkov - 1.12.0-1 +- Ver. 1.12.0 +- Dropped a lot of outdated patches. +- Added /usr/sbin/captype application. +- Added temporary workaround for wireshark.pc.in missing in the official + tarball. +- Removed outdated --with-dumpcap-group="wireshark" cli switch. It doesn't work + during rpmbuild, and we still set group explicitly in the 'files' section. +- Removed --enable-setcap-install. Likewise. +- Some ANSI C header files were moved to epan/ + * Fri Aug 1 2014 Peter Hatina - 1.10.9-1 - Ver. 1.10.9