Commit Graph

96 Commits

Author SHA1 Message Date
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
Kovarththanan Rajaratnam ad7042d2a4 calculate_crc32c -> crc32c_calculate for proper 'namespacing'
svn path=/trunk/; revision=30405
2009-10-08 15:10:43 +00:00
Anders Broman bc9a809b65 From Didier Gautheron:
ep memory can't be used for tvbs defined as data_source.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4054

svn path=/trunk/; revision=30376
2009-10-06 19:15:58 +00:00
Kovarththanan Rajaratnam 17c9803cac Sanitize epan includes
svn path=/trunk/; revision=29499
2009-08-21 20:25:24 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Anders Broman 4ec2c4ff47 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28363
2009-05-14 19:28:07 +00:00
Anders Broman 28bb6da642 From didier:
Wireshark doesn't parse iSCSI PDUs that their header spans multiple TCP segments

svn path=/trunk/; revision=25873
2008-07-30 14:28:04 +00:00
Jaap Keuter b6b71035e4 Fix for bug 2616:
According to RFC 3720 the login command doesn't require either T or C, just (C => !T)

svn path=/trunk/; revision=25470
2008-06-18 06:27:02 +00:00
Stig Bjørlykke 1dbe6e584a From Philip Frey (bug 2420):
Merge of the CRC32C calculation out of packet-iscsi.c and packet-sctp.c
into the already existing crc32.c and crc32.h files.

svn path=/trunk/; revision=24930
2008-04-12 12:31:53 +00:00
Stig Bjørlykke 28ae535b00 Removed even more "statement not reached" warnings.
svn path=/trunk/; revision=24286
2008-02-07 15:44:45 +00:00
Anders Broman 1950ffc214 Apply the small performance enhancment patches for:
- if offset is 0, tvb_length is the same as tvb_length_remaining, just faster.
Replace 
- col_append_fstr() with faster  col_append_str() 
- col_add_str() with col_set_str()
when it's safe

svn path=/trunk/; revision=23252
2007-10-23 05:50:00 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher ab8f589336 Fix about 100 simple to fix warnings from gcc 4.0 in epan/dissectors
svn path=/trunk/; revision=21233
2007-03-27 22:50:11 +00:00
Ulf Lamping 7994794ad9 fix a lot more warnings
svn path=/trunk/; revision=21142
2007-03-23 01:29:52 +00:00
Ronnie Sahlberg 39b2dd897d if DataSegmentLength is non zero for iscsi async messages the data segment contains
scsi sense information potentially followed by iscsi event data.

this is used by a target to tell an initiator (among other things) that the lun configuration has changed and now is a good time to rescan the target for lun changes.


svn path=/trunk/; revision=20531
2007-01-23 09:38:41 +00:00
Ronnie Sahlberg c413602d77 strengthen the heuristics for iscsi commandis assuming that the last 6 bytes of the 8 byte LUN blob are always 0.
svn path=/trunk/; revision=20058
2006-12-07 09:28:16 +00:00
Ronnie Sahlberg 8826c144f7 pass the relative data offset of data in/out pdu's to the scsi data in/out dissector (dissect_scsi_payload) so that we can later add reassembly of data pdu's
and also (if reassembly is disabled) only dissect the initial (offset==0) data pdu.

dissect_scsi_payload() does not yet use this parameter.


now that we have both data offset and expected data length/bidir expected data length and also the read/write flags availabe we have what we need to reassemble data in/out pdus    (modulo overflow/underflow  but those are so rare we can worry about them later).


ndmp:   ndmp conceptually always has a data in and a data out phase and never fragment the data into smaller pdu's os that dissector always report offset as 0.





svn path=/trunk/; revision=19511
2006-10-13 09:16:45 +00:00
Ronnie Sahlberg 15d3176063 wireshark does not yet consume enough memory for me to be happy
pass conversation form the transports up to the scsi layer

add tracking of conversation specific info to scsi osd
add tracking of conversation+lun specific info to scsi osd

for scsi osd   add tracking of PARTITIONS and display in which frame they were created/removed



svn path=/trunk/; revision=19505
2006-10-12 10:54:36 +00:00
Ronnie Sahlberg 145d7a0577 add a task_flags bitmap and two lengths (data and bidirectional data)
so that the two scsi transports   FCP and ISCSI can provide the expected data transfer lengths to SCSI  to allow SCSI reassembly.

NDMP does not really need these hints since for NDMP (and also iscsi-lite) there is conceptually always both data in and data out phases and there is never any fragmentation.



svn path=/trunk/; revision=19493
2006-10-11 11:32:56 +00:00
Ronnie Sahlberg 494e873eb0 move the ITL and the ITLQ structure to packet-scsi.h where it belongs
svn path=/trunk/; revision=19492
2006-10-11 10:38:59 +00:00
Ronnie Sahlberg 4d6a65270b scsi: unusual scsi protocols can request multiple AHS fields for iscsi so decode the AHS properly instead of assuming at most one field is present
scsi-osd   add dissection of  LIST data pdus  and  CREATE cdb


svn path=/trunk/; revision=19449
2006-10-08 04:13:18 +00:00
Ronnie Sahlberg af410bce95 fix for header digest detection being broken when AHS is used.
we simply forgot to account for the AHS when testing to calculate the crc


svn path=/trunk/; revision=19389
2006-09-30 21:49:11 +00:00
Ronnie Sahlberg 71af839c39 the ahs length inside the AHS for an extended cdb includes the reserved byte before the start of cdb data
account for this extra reserved byte in the ahs length so that the reconstructed cdb has the correct length and does not contain one extra byte at the end



svn path=/trunk/; revision=19387
2006-09-30 20:40:04 +00:00