Commit Graph

100 Commits

Author SHA1 Message Date
Pascal Quantin d8773b158a MQ: fix crash at startup
the array given to qsort algorithm must be alterable

Change-Id: I811cade161b7635e9bc9e070c1ec37d2cce50d1f
Reviewed-on: https://code.wireshark.org/review/6420
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-08 20:20:32 +00:00
Robert Grange a323f0ce3e packet-mq: Add New Def, Reformat Lines, re-order val_str def
Add missing definition, add new definition, Reformat some lines
Re-order the value_string used with ext_value_string definition
so they are in asc ASCII order as the ext_value_string is now
sorted before first use

renamed own tvb_get... funct to new tvb_get_guintxx funct
and deleted own tvb_get... funct
use ptvcursor_ funct instead of own macro to increment offset
removed <epan/tvbuff.h> in *.c files
correct [-Wunused-const-variable]

Change-Id: Iaee26289e098cde0e5787ca1c98de64b6b733fa2
Reviewed-on: https://code.wireshark.org/review/6079
Reviewed-by: Robert Grange <robionekenobi@bluewin.ch>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 09:32:59 +00:00
Martin Mathieson 7e8a4b0927 Deleting unnecessary #includes from dissectors.
Fourth batch (packet-mac-lte.c -> packet-rtp.c).

Will look at cleaning up and committing script afterwards.

Change-Id: Id921f07f4b274f0cfb77ce81abe4a285fdb8b644
Reviewed-on: https://code.wireshark.org/review/6023
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-23 17:16:40 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Guy Harris 2b006ad30e Have a heur_dissector_list_t be an opaque handle.
This allows dissector lists to be looked up by name, so they can be
shared by multiple dissectors.

(This means that there's no "udplite" heuristic dissector list, but
there shouldn't be one - protocols can run atop UDP or UDPLite equally
well, and they share a port namespace and uint dissector table, so they
should share a heuristic dissector table as well.)

Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7
Reviewed-on: https://code.wireshark.org/review/5936
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21 04:14:24 +00:00
Guy Harris 260af599de Values in a value_string_ext *must* be sorted.
Change-Id: I0c2bcd81955375abf3af24e42c70bea0bb960083
Reviewed-on: https://code.wireshark.org/review/5681
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-09 00:07:28 +00:00
Robert Grange 7f3f4a5307 paquet-mq: Eliminiate proto_tree_add_text
Eliminate proto_tree_add_text for Expert Info
Improve PCF Parameters numeric value display

Change-Id: Ibc259ba05d0591d434e7638d91d6943101d45305
Reviewed-on: https://code.wireshark.org/review/5080
Reviewed-by: Robert Grange <robionekenobi@bluewin.ch>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-15 15:56:38 +00:00
Robert Grange 20bac9d163 packet-mq: Use value_string_ext for big value string. more struct dissected
Use of value_string_ext for big value_strign array, sort them, to force use the btree search
parse more integer value with value_string

Bug: 9367
Change-Id: I49625cf2d46e0974cddde2c7b1767cb7d06ec47d
Reviewed-on: https://code.wireshark.org/review/5037
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-01 17:47:26 +00:00
Martin Kaiser 4664ac6e20 fix wrong offset for ID Capability Flags 1
reported by Jean-Marc Lamond

Bug: 10597
Change-Id: I481fad9cd0b8d55e3dd3af00cde2897105547f13
Reviewed-on: https://code.wireshark.org/review/4898
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-21 18:05:53 +00:00
AndersBroman 530f70fec2 Try to fix:
packet-mq.c:3653: warning: declaration of 'tree' shadows a parameter

Change-Id: I1226dac3764b15a097378aed7696567b9224f4c4
Reviewed-on: https://code.wireshark.org/review/3457
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-06 10:45:19 +00:00
robionekenobi 09357c116c mq improvements:
- handle RFH structure
- use tvb_reported_length...,
- Add Conversation/Request in row display

Change-Id: I84c5cf3e9479d91b363eb093e71bb6bdf07e8194
Reviewed-on: https://code.wireshark.org/review/3354
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-06 06:49:31 +00:00
Guy Harris db530d886d Squelch casting-away-constness warnings.
The pStr argument to dissect_mq_charv() isn't modified (and always
points to a character string), so make it a "const char *", and
eliminate the casts to "guint8 *" in calls to it.

Change-Id: I21dad38c41324528be297a8ddc1854beff2276db
Reviewed-on: https://code.wireshark.org/review/2877
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 11:25:41 +00:00
Michael Mann c7a6e6fa13 convert to proto_tree_add_subtree[_format]
Change-Id: I621f2e2cad9403449cb78f45302388f0c874d3bc
Reviewed-on: https://code.wireshark.org/review/2852
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-04 16:59:14 +00:00
Guy Harris ce3d2ff3de Rename dissector_add_handle() to dissector_add_for_decode_as().
Hopefully that name makes it clear what the routiner's purpose is, and
will encourage people to use it rather than using dissector_add_uint()
with a bogus integer value.

Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8
Reviewed-on: https://code.wireshark.org/review/2483
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 16:43:56 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
AndersBroman 2cfda31ff0 Change the signature of dissector_try_heuristic() to return hdtbl_entry
which can be used to call the found heuristic dissector on the next pass.

Introduce call_heur_dissector_direct() to be used to call a heuristic
dissector which accepted the frame on the first pass.

Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582
Reviewed-on: https://code.wireshark.org/review/1697
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-21 20:17:29 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Gilbert Ramirez 4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of
having each caller cast its private data to (void**), we use void*
in the uat_new() API itself. Inside uat_new(), we cast the void*
to void**.

Some dissectors use val64_string arrays, so a VALS64() macro was
added for those, to avoid using VALS(), which is useful only for
value_string arrays.

packet-mq.c was changed because dissect_nt_sid() requires
a char**, not a guint**. All other callers of dissect_nt_sid() use
char*'s (and take the address of it) for their local storage. So,
this was changed to follow the other practices.

A confusion between gint and absolute_time_display_e in packet-time.c
was cleared up.

The ugliest fix is the addition of ip6_guint8_to_str(), for exactly
one caller. The caller uses one type of ip6 address byte array,
while ip6_to_str() expects another. This new function is in place
until the various address implementations can be consolidated.

Add VALS64() to the developer documentation.

Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805
Reviewed-on: https://code.wireshark.org/review/48
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 09:26:10 +00:00
Alexis La Goutte 8299c8deeb Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
svn path=/trunk/; revision=54578
2014-01-03 10:22:10 +00:00
Bill Meier 756457682d From robionekenobi: packet-mq enhancement
Add new Structure dissection
 Fix some small issues
 Reformat some part of code
 use spaces instead of tabs for indentation

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9603

From me:
 Remove some trailing whitespace;
 Change a few tabs to spaces;
 Change editor-modelines tab-width, etc to 8 (altho
   not really relevant since tabs not being used).

svn path=/trunk/; revision=54489
2013-12-29 20:58:27 +00:00
Bill Meier 72e5288fdd Per user request, revert reformatting of hf[] entries done in SVN #54005.
See wireshark-dev message thread begining at:
 https://wireshark.org/lists/wireshark-dev/201312/msg00156.html


svn path=/trunk/; revision=54226
2013-12-18 16:52:51 +00:00
Jakub Zawadzki 715e2d6699 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54095
2013-12-14 16:09:57 +00:00
Evan Huus e57d150ec9 Fix string length typo causing unitialized-value warnings caught by valgrind
fuzzing.

svn path=/trunk/; revision=54083
2013-12-14 01:40:39 +00:00
Bill Meier 721b5d266a Do one or more of the following:
- Convert "4 space tabs" to spaces;
- Remove some unneeded initializers;
- 'offset++' --> 'offset += 1' for consistency;
- Reformat hf[] entries;
- Rework/add whitespace;
- Adjust editor modelines (set tab-width to 8).

svn path=/trunk/; revision=54005
2013-12-13 00:44:32 +00:00
Bill Meier 043f18baa4 Do some whitespace & formatting style changes;
Remove some unneeded initializers;
Also: packet-mq.c: Add an XXX coment.

svn path=/trunk/; revision=53244
2013-11-11 01:54:42 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +00:00
Bill Meier c4efddd7d2 From robionekenobi: "packet-mq adapted"
See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9367
      especially comments 8,9,12,13

Patch: https://bugs.wireshark.org/bugzilla/attachment.cgi?id=12014

From me: Remove several uses of DEF_VALSEXT macro
         since the above patch removed the definition.

(It seems that Microsoft C expands undefined macros as null;
 GCC complains).


svn path=/trunk/; revision=53101
2013-11-06 15:28:23 +00:00
Bill Meier 0243d69057 From robionekenobi: Enhancement of the packet-mq dissector (WMQ 7.1-7.5)
Add more detail for SPI Open LPOO Structure
 Add more int_to_vals for INQ_Q_MGR reply
 Add more display detail for encoding value
 Some fix and display correction

Note: The patch used was the *original* patch submitted (plus some fixes by me).

That is: (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=11962)
         plus my fixes

See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9367 and comments for
details.

From me:
- Fix bug which resulted in a macro expansion fail on GCC
- Fix a -Wshadow error in packet-mq-pcf.c


svn path=/trunk/; revision=53078
2013-11-04 18:55:06 +00:00
Bill Meier 953815dd11 Revert SVN #53027: It gives compile warning on GCC (at least).
(No time right now to figure the problem out).

 CC       libdissectors_la-packet-mq-base.lo
In file included from packet-mq-base.c:32:0:
packet-mq.h:42:54: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_ext'
 #define DEF_VALSEXT(A)  value_string_ext GET_VALSV(A)_ext = VALUE_STRING_EXT_INIT(GET_VALSV(A))
                                                      ^
packet-mq-base.c:1301:1: note: in expansion of macro 'DEF_VALSEXT'
 DEF_VALSEXT(selector);
 ^
packet-mq.h:42:54: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_ext'
 #define DEF_VALSEXT(A)  value_string_ext GET_VALSV(A)_ext = VALUE_STRING_EXT_INIT(GET_VALSV(A))
                                                      ^
packet-mq-base.c:1495:1: note: in expansion of macro 'DEF_VALSEXT'
 DEF_VALSEXT(mqcmd);
 ^


svn path=/trunk/; revision=53033
2013-11-01 21:39:23 +00:00
Bill Meier 02f2b76bdd From robionekenobi: Enhancement of the packet-mq dissector (WMQ 7.1-7.5)
Add more detail for SPI Open LPOO Structure
Add more int_to_vals for INQ_Q_MGR reply
Add more display detail for encoding value
Some fix and display correction

See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9367


svn path=/trunk/; revision=53027
2013-11-01 20:13:15 +00:00
Pascal Quantin 33e376d180 From robionekenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9267 :
Fix compilation of packet-mq.c

svn path=/trunk/; revision=52715
2013-10-20 16:57:38 +00:00
Michael Mann 94c3d21550 Enhancement of the packet-mq dissector (WMQ 7.1-7.5). Bug 9267 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9267)
From robionekenobi

From me: Pass data through dissectors instead of using pinfo->private_data

svn path=/trunk/; revision=52707
2013-10-20 12:11:55 +00:00
Michael Mann 07f25c7f3c WebSphere MQ V7 Bug Fix 8322 TSHM_EBCDIC. Bug 9198 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9198)
From Ed Beroset.

svn path=/trunk/; revision=52404
2013-10-06 15:51:31 +00:00
Evan Huus e0cb13c13c From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9215
better handling of CAUT Structure in mq dissector

svn path=/trunk/; revision=52347
2013-10-04 00:33:58 +00:00
Jeff Morriss 221f85fd67 From robionekenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9173 :
This enhancement add the missing structure CAUT, some missing integer
converted to Strings and some field that were unknown to a better explanation. 

Sorted alphabetically the MQCFINT_Parse VALS structure to better find what is
missing in this VALS structure

svn path=/trunk/; revision=52198
2013-09-24 01:04:10 +00:00
Alexis La Goutte bd3d51b5fe Fix Function call argument is an uninitialized value warning found by Clang
svn path=/trunk/; revision=52186
2013-09-23 07:20:53 +00:00
Alexis La Goutte 044951858f Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=52184
2013-09-23 07:20:38 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Evan Huus adb39445ee Apparently some platforms don't like $ in their macro names. Fix it.
svn path=/trunk/; revision=52090
2013-09-15 22:36:47 +00:00
Evan Huus da27bad13b Comment out hf_ var whose use is also commented out at least for now.
svn path=/trunk/; revision=52086
2013-09-15 21:01:45 +00:00
Evan Huus 5bd199d8f5 From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9072
Substantial enhancements to MQ protocol: all Structure, MSG_REQUEST/ASYNC_RESP,
MQ Multi Segment are decoded until version 7.1/7.5

svn path=/trunk/; revision=52085
2013-09-15 20:56:56 +00:00
Pascal Quantin 7850883904 emem -> wmem
svn path=/trunk/; revision=52063
2013-09-15 15:11:11 +00:00
Martin Kaiser 8445c81d50 (try to) fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9079
don't enter the for loop if there are no components to dissect

svn path=/trunk/; revision=51603
2013-08-30 18:13:54 +00:00
Jakub Zawadzki a18172147f Remove fragment_data, add fragment_head, fragment_item - for now alias it to the same structure.
This is begin of work to split fragment head and fragments items.

svn path=/trunk/; revision=50708
2013-07-17 21:12:24 +00:00
Jakub Zawadzki c766e78cfa Rewrite reassemble API to use TVBs instead of raw data.
(it seems to be working for TCP ^^)

svn path=/trunk/; revision=50580
2013-07-14 14:42:05 +00:00
Michael Mann de68fd6eea Removed check_col() and the occasional tree.
svn path=/trunk/; revision=49938
2013-06-14 17:49:53 +00:00
Guy Harris a2414d8909 Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols
running atop TCP should be done on flows from one TCP endpoint to
another.

We do this by:

	adding "reassembly table" as a data structure;

	associating hash tables for both in-progress reassemblies and
	completed reassemblies with that data structure (currently, not
	all reassemblies use the latter; they might keep completed
	reassemblies in the first table);

	having functions to create and destroy keys in that table;

	offering standard routines for doing address-based and
	address-and-port-based flow processing, so that dissectors not
	needing their own specialized flow processing can just use them.

This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where
the second YPALL response is processed as if it were a continuation of
a previous response between different endpoints, even though said
response is already reassembled), and also allows the DCE RPC-specific
stuff to be moved out of epan/reassembly.c into the DCE RPC dissector.

svn path=/trunk/; revision=48491
2013-03-22 23:59:54 +00:00
Evan Huus 090d5e7eda From metatech via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8322
MQSeries V7 protocol support.

svn path=/trunk/; revision=47641
2013-02-12 16:13:25 +00:00