Commit Graph

119 Commits

Author SHA1 Message Date
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
Alexis La Goutte 5742802a73 From Yaniv Kaul via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9551
Dissect SCSI XCOPY and RECEIVE COPY Parameters commands

From me :
Fix encoding-args
Fix trailing whitespace

svn path=/trunk/; revision=54381
2013-12-23 13:45:07 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Jakub Zawadzki d6da7a01b1 Fix warnings + remove some v. old comment from strutil.h
svn path=/trunk/; revision=54078
2013-12-13 23:11:14 +00:00
Michael Mann 5c4a125202 Correctly update the data length of the SCSI payload within ISCSI. Bug 9521 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9521)
From Yaniv Kaul

svn path=/trunk/; revision=53838
2013-12-08 01:15:55 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +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
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Evan Huus c0763b00bd More wmem.
svn path=/trunk/; revision=51619
2013-08-31 16:17:31 +00:00
Pascal Quantin b46f9bebe2 Change some dissectors to use pinfo memory pool instead of malloc if it can trigger an exception between between buffer allocation and tvb_set_free_cb call
svn path=/trunk/; revision=51427
2013-08-19 14:55:41 +00:00
Jeff Morriss a441793cba Move a couple of time-related modules into wsutil.
A bunch of files didn't really need to include these header files so remove
the include line rather than changing it.

svn path=/trunk/; revision=50154
2013-06-25 22:02:20 +00:00
Michael Mann 0f0c111119 Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49920
2013-06-14 01:02:11 +00:00
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Ronnie Sahlberg 37de47688f ISCSI: When printing the task management function, strip of the high bit which is always 1 before resoving the index into a name
svn path=/trunk/; revision=48604
2013-03-28 00:06:19 +00:00
Anders Broman 6bde918078 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48426
2013-03-19 20:00:52 +00:00
Jeff Morriss 0266cceef3 Make all enum_val_t's const.
svn path=/trunk/; revision=46292
2012-11-29 20:15:37 +00:00
Guy Harris 85b3da7c63 Clean up the "round up to a multiple of 4" code a bit.
svn path=/trunk/; revision=45548
2012-10-14 22:53:25 +00:00
Evan Huus e2c898959c Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7858
Use a full 32-bit literal instead of just a 16-bit one. Fixes case where
the value we're &-ing with just slips over 2^16, making us get stuck
in an infinite loop.

I'm not sure this matches the iscsi spec anymore, the comment in the code
about padding bytes is ambiguous as to whether they're leading or trailing.

svn path=/trunk/; revision=45524
2012-10-13 22:12:52 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Ronnie Sahlberg a6c45b0582 iSCSI: DATA-IN only contain LUN and TTT iff the A-bit is set
svn path=/trunk/; revision=44550
2012-08-17 03:51:43 +00:00
Ronnie Sahlberg 9465a06fe7 SCSI/ISCSI: Add decode of LUNs with address mode/bus and lun
Dont implement the complex "extended logical unit addressing format" just
yet. That one is hairy  so wait until we actually see it in the wild first.

Add decoding of LUNs using
single level lun structure and flat addressing space modes



svn path=/trunk/; revision=44058
2012-07-27 05:09:13 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Chris Maynard a4599ecdb7 Use tvb_get_ntoh48() instead of tvb_get_ntohs() || tvb_get_ntohl().
svn path=/trunk/; revision=40301
2011-12-27 17:08:33 +00:00
Bill Meier 30cee99009 Fix a number of proto_tree_add_item() encoding args.
svn path=/trunk/; revision=39774
2011-11-09 17:33:18 +00:00
Bill Meier a25e421a10 Fix some [-Wunused-but-set-variable] warnings
(in some cases by changing proto_tree_add_item() to use
  what appears to be the correct 'tree' arg);
Do whitespace cleanup.

svn path=/trunk/; revision=39772
2011-11-09 02:48:51 +00:00
Anders Broman ae8165fd4c Fix some set but not used [-Wunused-but-set-variable] warnings.
svn path=/trunk/; revision=39579
2011-10-25 20:08:26 +00:00
Bill Meier 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00
Bill Meier af3ae8ceea Fix "unused variable" compile error.
svn path=/trunk/; revision=39352
2011-10-10 23:45:33 +00:00
Bill Meier ee395460d0 Fix benign bugs in some proto_tree_add_item() 'encoding' args;
svn path=/trunk/; revision=39351
2011-10-10 23:36:07 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Stig Bjørlykke 5359494b1f Second try to move crc routines to libwsutil.
This time keep the tvb routines in epan.

Now we can use common crc routines outside epan.

svn path=/trunk/; revision=38810
2011-08-31 09:00:54 +00:00
Stig Bjørlykke 71f903b956 Revert r38800, as the crc routines contains some tvb functions.
svn path=/trunk/; revision=38803
2011-08-30 14:17:40 +00:00
Stig Bjørlykke 4132d40e50 Move all crc routines to libwsutil.
This way we can use the crc routines in wiretap.

svn path=/trunk/; revision=38800
2011-08-30 13:46:42 +00:00
Jeff Morriss f8034556e5 From Anish Bhatt via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6113 :
The standard iscsi dissector only recognizes iscsi traffic to and from port
3260 as specified. However, it doesn't understand traffic in MPIO/MCS
connections where the iscsi target runs on a range of ports (3260-3270 for
eg.); or rather it will ignore all iscsi traffic not on the specified port.

Attached patch adds ability to recognize iscsi traffic over a range of ports.
Default range is set to 3260-3260, so it behaves exactly like the current
dissector.


From me:

Don't surround a bunch of code in proto_register_iscsi() with braces just to
allow a new variable to be declared (without incurring the wrath of
non-C99-compliant compilers): just declare the variable at the top of the
function.

svn path=/trunk/; revision=38492
2011-08-11 21:59:02 +00:00
Jeff Morriss 38b9f1cfbd As suggested by Didier in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3055 :
Apply rev 25869 to some more dissectors.

svn path=/trunk/; revision=36333
2011-03-25 20:04:54 +00:00
Ronnie Sahlberg 24eb2e7b6e The NSG bits in the login pdu are 0x0c not 0xc0
coverity 344


svn path=/trunk/; revision=36273
2011-03-23 04:50:17 +00:00
Ronnie Sahlberg 2c7c20667d iSCSI REJECT PDU contains the full header of the offending command as payload.
Add dissection of this header.


svn path=/trunk/; revision=36078
2011-02-27 01:11:24 +00:00
Jeff Morriss f36e2be287 Use tvb_memeql() and tvb_memcpy().
Use tvb_ip_to_str() and tvb_ip6_to_str().

There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().

Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s to ensure the
return string is NULL terminated.

svn path=/trunk/; revision=35546
2011-01-16 03:35:29 +00:00
Jaap Keuter db699d12c8 From Alexis La Goutte:
Remove unused header fields.

svn path=/trunk/; revision=34771
2010-11-04 06:42:17 +00:00
Jaap Keuter b7920c07c5 From Alexis La Goutte:
Replace all *_min()/*_max() by MIN() and MAX().

svn path=/trunk/; revision=34767
2010-11-04 06:36:33 +00:00
Bill Meier 93b94a23ca Define some fcns & vars as static; Some #includes not req'd; packet-mikey.h not req'd.
svn path=/trunk/; revision=34464
2010-10-10 23:28:40 +00:00
Ronnie Sahlberg 415f314c53 iscsi also has a system port (860) registered in addition to the more common
port (3260).

add knowledge about the registered system port for iscsi to the heuristics
so we automatically detect when iscsi is transported over this optional port.


svn path=/trunk/; revision=32881
2010-05-18 22:00:17 +00:00
Jeff Morriss 729de1a635 As suggested in http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html
(as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 :

Write a new convenience routine for finding a conversation and, if it is not
found, create it.  The frame number and addresses are taken from pinfo (as is
the common case).

Use this function in a bunch of dissectors.

svn path=/trunk/; revision=32790
2010-05-13 18:28:34 +00:00
Gerald Combs 8463e2e8bc Terminate a string so that strchr doesn't wander off. Hopefully fixes bugs
4725 and 4728.

svn path=/trunk/; revision=32608
2010-04-29 22:36:40 +00:00
Jeff Morriss 07cab74535 Make a variable a guint8* instead of a char* since it a) holds TVB data and b) matches what tvb_new_child_real_data() wants for its 2nd argument. This cleans up a warning from the Sun compiler.
svn path=/trunk/; revision=32598
2010-04-29 14:58:22 +00:00
Jeff Morriss 7e11e3ddcd Use strchr() instead of index()--Windows doesn't appear to have the latter.
svn path=/trunk/; revision=32597
2010-04-29 14:38:26 +00:00
Ronnie Sahlberg dd9f8286cc It is becomming more common that iscsi vendors use iscsi-redirectors and redirect
initiators to a different host/port and thus often redirect to non-3260.

The heuristics to detect iscsi is quite weak since there is very little
in the average iscsi header that can be used to semi-reliably identify
something as iscsi and not random data/something else.
As such, the heuristics also use/rely on the port being 3260 in order
to reduce the otherwise massive numbver of false positives that would arise.


Add decoding of the text key/value pairs and trigger on TargetAddress.
This field would describe a address/port where we can quite reliably 
assume that this traffic is indeed iscsi and not something else.


When seeing the iscsi redirect/TargetAddress, use this as a signalling hint
and register a conversation dissector for TCP to that address/port so that 
any future packet to/from this port is sent to the iscsi dissector.


If the signalling/redirect is not in the capture, wireshark will not detect
the traffic as iscsi and the user will have to use DecodeAs.  and manually
\set it to iscsi.



svn path=/trunk/; revision=32595
2010-04-29 08:41:23 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00