Commit Graph

80 Commits

Author SHA1 Message Date
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
Ronnie Sahlberg bedacc2bc2 scsi osd updates
iscsi: when iscsi transfers a cdb that is alrger than 16 bytes,  the first 16 bytes are transferred in the normal place in the header and ther remainder of the cdb is transported inside the AHS.

reassemble these cdb into a proper tvb before passing it to the scsi dissector



svn path=/trunk/; revision=19376
2006-09-30 09:34:58 +00:00
Ronnie Sahlberg 62290c9cc5 add an extra_data pointer to the itlq structure where specific commandsets/cdbs can hang additional data that are unique to that commandset/cdb
make the scsi osd service action and getsetattributetype use this facility

furhter enhancements to scsi osd


svn path=/trunk/; revision=19374
2006-09-30 04:10:28 +00:00
Ronnie Sahlberg deef583ae5 scsi opcode 0x7f is variable length so dont clamp the cdb length to 16 bytes
svn path=/trunk/; revision=19373
2006-09-30 01:01:57 +00:00
Ronnie Sahlberg 59d9a1b9c2 add a missing heuristic to acept a NOP_IN packet and correct a broken heuristic that would refuse all NOP_OUT pdus as non-iscsi
it is absolutely amazing that none of the iscsi implementors and users of wireshark had noticed this breakage and reported it.   they apparently do not use wireshark.


svn path=/trunk/; revision=19362
2006-09-29 11:12:18 +00:00
Ronnie Sahlberg 8ce8e719e0 rename some structures and defines from the se_tree to the emem_tree prefix
svn path=/trunk/; revision=18894
2006-08-14 08:29:29 +00:00
Ronnie Sahlberg 797bb2d5d7 for iscsi traces where there is a lot of packetloss the dissector frequently gets out of sync
and the weak heuristics often cause wireshark to mistake some segment containing read/write data to be iscsi.


make the heuristics to check that a packet really is iscsi much stronger


svn path=/trunk/; revision=18523
2006-06-20 13:16:50 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Ronnie Sahlberg acbaf3fe1f change the signature for dissect_scsi_snsinfo() to take itlq and itl structures
update the comment in packet-scsi.c   to reflect that it is the transport now that is responsible to track itl and itlq data

make scsi tapable

svn path=/trunk/; revision=17974
2006-04-24 08:16:18 +00:00
Ronnie Sahlberg e776696d14 the scsi transports (fc/fcp and iscsi) now track both itl and itlq
structures for scsi.

we no longer need the scsi_task_id structure passed by pinfo->private_data   so get rid of it.

we no longer need the (broken by design) scsi_task_data   hash table   since this has been replaced byt hte itl and itlq structures and tracking




svn path=/trunk/; revision=17952
2006-04-22 02:16:52 +00:00
Ronnie Sahlberg 73e65216bc remover the lun parameter from dissect_scsi_cdb/payload since this is now part of the exchange data in itlq
remove the two fields opcode and devtype from the scsi_task_data structure since these are also part of the itlq and itl structures



svn path=/trunk/; revision=17949
2006-04-21 22:00:38 +00:00
Ronnie Sahlberg 60e65f4869 updates to get the fc and scsi dissectors
and get rid of some breakage in the design


let the scsi transport keep track of itl (initiator, target, lun) matching
and let it pass a itl structure to scsi   that is persistent across packets.

let scsi use this itl structure to track device type for a specific itl instead of the (must have been) broken hashtable.

update both iscsi and fc to track the itl structure for scsi and schange the scsi signature to accept itl as a parameter.


more to come.



svn path=/trunk/; revision=17942
2006-04-21 11:08:24 +00:00
Ronnie Sahlberg 2b2f2e3f03 rename hte itlq structures to itlq
svn path=/trunk/; revision=17922
2006-04-20 09:43:56 +00:00
Ronnie Sahlberg a72d39bb05 rename the fc_exchange_data structure to the more appropriate itlq_nexus_t
svn path=/trunk/; revision=17921
2006-04-20 09:16:09 +00:00
Ronnie Sahlberg 9481eac669 make dissect_scsi_rsp() take an exchange structure as parameter instead of just a lun.
this finally allows us to have scsi.time  for scsi transactions   but we need to cleanup and refactor the other three scsi entrypoints before we should implement scsi srt    to make the other three also take an exchange data structure as parameter from their transports (and get rid of the pinfo->private_data )


svn path=/trunk/; revision=17838
2006-04-07 10:15:15 +00:00
Ronnie Sahlberg 2fbe952694 change iscsi to track transaction data in a fc_exchange_data structure just as the fc / fcp transport does.
while reusing this structure for multi-purpose would make it berret suited to move the struct from packet-fc.h to packet-scsi.h
we would have to include packet-scsi.h   for everyone that includes packet-fc.h  and that are a few dependencies.
(would have to include it even in packet-llc.c)

so leave it as a fc structure for now.




svn path=/trunk/; revision=17833
2006-04-06 11:05:18 +00:00
Ronnie Sahlberg 26bbda330d remove the hashtables for pdu tracking and replace with an se_tree
indexed by itt


svn path=/trunk/; revision=17832
2006-04-06 10:41:49 +00:00