Commit Graph

324 Commits

Author SHA1 Message Date
J. Bruce Fields 1a8ed6fa28 Fix NFSv4.2 CHANGE_TYPE constants
See https://tools.ietf.org/html/rfc7862#section-12.2.3

As far as I can tell these were zero-based even in the earliest protocol
drafts, so this was just a mistake in the original wireshark submission
that nobody caught because change_attr_type hasn't been widely
implemented.

While we're here, move the defines before the array for better
readability.

Change-Id: Ie721250748fe77098aee4e2cc502ae43fc497a2d
Reviewed-on: https://code.wireshark.org/review/28271
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-16 10:21:27 +00:00
Jorge Mora 8f0f691312 RPC-over-RDMA: add reassembly for reply, read and write chunks
The RDMA reply chunk is used for a large RPC reply which does not fit
into a single SEND operation and does not have a single large opaque,
e.g., NFS READDIR. The RPC call packet is used only to set up the RDMA
reply chunk. The whole RPC reply is transferred via RDMA writes.
Fragments are added on any RDMA write packet, RDMA_WRITE_ONLY,
RDMA_WRITE_FIRST, etc., and the reassembly is done on the reply
message. The RPC reply packet has no data (RDMA_NOMSG) but
fragments are reassembled and the whole RPC reply is dissected.

The RDMA read chunk list is used for a large RPC call which has
at least one large opaque, e.g., NFS WRITE. The RPC call packet
is used only to set up the RDMA read chunk list. It also has the
reduced message data which includes the first fragment (XDR data
up to and including the opaque length), but it could also have
fragments between each read chunk and the last fragment after
the last read chunk data. The reduced message is then broken
down into fragments and inserted into the reassembly table.
Since the RDMA read chunk list is set up in the RPC call
then do not dissect the upper layer in this case and just
label rest of packet as "Data" since the reassembly will
be done on the last read response.

The protocol gives the XDR position where each chunk must be
inserted into the XDR stream thus as long as the maximum
I/O size is known it is possible to know exactly where to
insert these fragments. This maximum I/O size is set on the
first READ_RESPONSE_FIRST or READ_RESPONSE_MIDDLE but in case
where any of these packets have not been seen then a value
of 100 is used (real value should be at least 1024) but in
this case the message numbers are not consecutive between
chunks but since the total size of all chunks is verified to
make sure there is a complete message to reassemble then all
fragments should be in the correct order.

Fragments are added on any RDMA read packet: RDMA_READ_RESPONSE_ONLY,
RDMA_READ_RESPONSE_FIRST, etc., and the reassembly is done on the
last read response. Since there could be multiple chunks and each
chunk could have multiple segments then the total size must be
checked to complete the reassembly because in this case there
will be multiple READ_RESPONSE_LAST.

The RDMA write chunk list is used for a large RPC reply which has
at least one large opaque, e.g., NFS READ. The RPC call packet is
used only to set up the RDMA write chunk list. The opaque data is
then transferred via RDMA writes and then the RPC reply packet is
sent from the server.

The RPC reply packet has the reduced message data which includes
the first fragment (XDR data up to and including the opaque length),
but it could also have fragments between each write chunk and the
last fragment after the last write chunk data. The reduced message
is then broken down into fragments and inserted into the reassembly
table. Since the RPC reply is sent after all the RDMA writes then
the fragments from these writes must be inserted in the correct
order: the first RDMA write fragment is inserted with message
number 1, since the first fragment (message number 0) will come
from the very last packet (the RPC reply with RDMA_MSG). Also,
the last packet could have fragments which must be inserted in
between chunk data, therefore message numbers from one chunk to
another are not consecutive.

In contrast with the RDMA read chunk list, the protocol does not
allow an XDR position in the RDMA write chunks, since the RPC
client knows exactly where to insert the chunk's data because
of the virtual address of the DDP (direct data placement) item.
There is no way to map a virtual address with an XDR position,
thus in order to reassemble the XDR stream a two pass approach
is used. In the first pass (visited = 0), all RDMA writes are
inserted as fragments leaving a gap in between each chunk.
Then the dissector for the upper layer is called with a flag
letting the dissector know that it is dealing with a reduced
message so all DDP enabled operations handle the opaque data
as having only the size of the opaque but not the data and
reporting back the offset from the end of the message.
Once the upper layer dissector returns, this layer now has a
list of DDP eligible item's offsets which are then translated
into XDR offsets and then the RPC reply packet is broken into
fragments and inserted in the right places as in the case for
the RDMA read chunk list. On the second pass (visited = 1),
all fragments have already been inserted into the reassembly
table so it just needs to reassembled the whole message and
then call the upper layer dissector.

RFC 8267 specifies the upper layer bindings to RPC-over-RDMA
version 1 for NFS. Since RPC-over-RDMA version 1 specifies the
XDR position for the read chunks then only the write chunk DDP
eligible items are handled in the upper layer, in this case the
NFS layer. These are the only procedures or operations eligible
for write chunks:
* The opaque data result in the NFS READ procedure or operation
* The pathname or linkdata result in the NFS READLINK procedure
  or operation

Two functions are defined to signal and report back the DDP
eligible item's offset to be used by the upper layers.
Function rpcrdma_is_reduced() is used to signal the upper layer
that it is dealing with a reduced data message and thus should
ignore DDP eligible item's opaque processing and just report
back the offset where the opaque data should be. This reporting
is done using the second function rpcrdma_insert_offset().

Reassembly is done for InfiniBand only. Reassemble fragments using
the packet sequence number (PSN) of each RDMA I/O fragment to make
sure the message is reassembled correctly when fragments are sent
out of order. Also a unique message id is used for each message so
fragments are reassembled correctly when fragments of different
messages are sent in parallel.

The reassembled message could be composed of multiple chunks
and each chunk in turn could be composed of multiple segments
in which each segment could be composed of multiple requests
and of course each request is composed of one or more fragments.
Thus in order to have all fragments for each segment belonging
to the same message, a list of segments is created and all
segments belonging to the same message are initialized with
the same message id. These segments are initialized and added
to the list on the call side on RDMA_MSG by calling
process_rdma_lists.

Bug: 13260
Change-Id: Icf57d7c46c3ba1de5d019265eb151a81d6019dfd
Reviewed-on: https://code.wireshark.org/review/24613
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-24 07:09:59 +00:00
Guy Harris d332507ef2 Fix the "pointer to function that generates a label" values.
build_label_func is a pointer type, pointing to a function that can be
used to generate a label for a "Decode As" entry.  There's no need to
have pointers to those pointers; have register_decode_as_next_proto()
take a build_label_func, not a build_label_func *, as its last argument,
assign that value rather than dereferencing it, get rid of unnecessary
casts, and fix the comment in epan/decode_as.h for that argument.

Change-Id: Idc3cf18204c543a2191b122c8129b362562c0ecd
Reviewed-on: https://code.wireshark.org/review/25773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-13 18:06:11 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Tom Haynes 0b997f3a3a nfs: Add the second version of the Primary Data NFSv4 file handle dissector
Change-Id: I05da9a546f5de81783e4c9d004aff7dbb3ead44b
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/25146
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-04 23:50:26 +00:00
Guy Harris 458c3c026e Add a ws_in6_addr typedef for struct e_in6_addr.
That allows a parallel typedef of ws_in4_addr for guint32.

Change-Id: I03b230247065e0e3840eb87635315a8e523ef562
Reviewed-on: https://code.wireshark.org/review/24073
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26 08:50:34 +00:00
Cal Turney b913bcc13a NFSv4: Fix for duplicate StateId hashes
In WS v11.4.0 released In May, 2014, "tvb_get_string_enc()" was added to
dissect_nfs4_stateid() which treats the numeric stateid as a string and
converted it to UTF-8. Invalid UTF-8 chars were replaced with the
"REPLACEMENT CHARACTER" which are actually three characters: 0xef, 0xbf,
and 0xbd (0xefbfbd). A hash was made of the first 16 chars of the returned
array although the string was often much larger due to 1 to 16 invalid
chars. This has often caused duplicate hashes for different files and
locks. That routine has been removed. In addition, the size of the hash
has been reduced from 32 to 16 bits which affords a 99.9984% chance of
unique hashes. Finally, hf_nfs4_seqid, used for the stateid hash seqid
has been changed to hf_nfs4_seqid_stateid because in CLOSE requests the
seqid has nothing to do with the stateid seqid.

Change-Id: I3bf7caefc3341887a4c9137500dfeac0115af8cf
Reviewed-on: https://code.wireshark.org/review/23966
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-22 13:11:21 +00:00
Tigran Mkrtchyan 731434cbca nfs: fix nfs dissector to show correct mirror and data server counts
nfs dissector wrongly have used proto_tree_add_item to display a
counter, by assuming that last argument is a value.

Replace proto_tree_add_item with proto_tree_add_uint or
proto_tree_add_subtree_format when a loop counter must be
displayed. Update tree item size calculation.

Change-Id: I4137e42673fa33cae61494effe1195206fbf7f28
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Reviewed-on: https://code.wireshark.org/review/23748
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-17 03:33:12 +00:00
Alexis La Goutte d477ea35a9 nfs: fix typo on new xattrs attribut
Change-Id: I4872334e73df8a71690400e7f0690eecc02d8270
Reviewed-on: https://code.wireshark.org/review/23820
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>
2017-10-03 06:34:32 +00:00
Tom Haynes 5d672c469d nfs4: Add ACCESS_MASK support for xattrs
See: https://datatracker.ietf.org/doc/draft-ietf-nfsv4-xattrs/

Change-Id: Ia9238bf96562f95eb56d25a1f8051b4e4fca5ba4
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/23817
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-03 04:33:12 +00:00
Tom Haynes 492da78a2c nfsv4: Implement the xattr support for NFSv4
See: https://datatracker.ietf.org/doc/draft-ietf-nfsv4-xattrs/

Change-Id: I775eb2ec994409717f5d4ab9feb07cb4201617f1
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/23756
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-27 10:51:00 +00:00
Michael Mann 7d65b573f2 Have register_decode_as_next_proto create dissector table.
For protocols that have don't have a unique identifier for their
payload, have register_decode_as_next_proto be a one stop shop to
create Decode As functionality and a dissector table of type FT_NONE.

Change-Id: Ic1f2e9ed0aee0554a4eb8f232630b99c0604dfc0
Reviewed-on: https://code.wireshark.org/review/22575
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-16 11:12:29 +00:00
Michael Mann 78a14e4c57 packet-nfs.c: Minor cleanup
Change-Id: Id1b522ae912a05442426d2acc1a036d1ba5689e2
Reviewed-on: https://code.wireshark.org/review/23380
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: Michael Mann <mmann78@netscape.net>
2017-09-04 01:27:42 +00:00
Michael Mann 9b3c8d4515 Expand register_decode_as_next_proto to include prompt string.
Many dissectors don't have an identifier to pass to a dissector table.
When using Decode As they all have a "value" function that returns 0
just so something is returned.

A first step to a cleaner refactor of the functionality is to allow
dissectors to provide a "prompt" function when registering Decode As
with register_decode_as_next_proto() so that the text exposed in
the GUI can vary, but the function that returns 0 (nothing) can be
consolidated under decode as registration functionality.  This casts
a wider net for register_decode_as_next_proto() use.

Change-Id: I2995b3c251dae70f5f529b672473d25c6288ed5c
Reviewed-on: https://code.wireshark.org/review/22562
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-11 08:41:49 +00:00
Andreas Gruenbacher 844cf1ac90 NFSv4.2 mode_umask support
Add support for the NFSV4.2 mode_umask attribute which will be initially
supported by Linux v4.10.

Change-Id: Id98e20cd0ed93bf7ad9b2246e9e05299f3d7a9fc
Reviewed-on: https://code.wireshark.org/review/19921
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-02 21:18:52 +00:00
Guy Harris 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Michael Mann 79fc411936 Convert some easily identifiable pinos.
grepping for "Decode As" comments reveals exactly was pinos were
created for - distinguishing multiple dissection functions in a
single dissection table.

Change-Id: Iaa9294045e9d0633563e7d763cb585c0e6dc598f
Reviewed-on: https://code.wireshark.org/review/19490
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-06 12:48:47 +00:00
Michael Mann b7f4e25059 Adjust proto_tree_add_uint_format_value calls to use unit string
Several calls to proto_tree_add_uint_format_value could be better served
using BASE_UNIT_STRING with a "unit string" in hf_ field.  There also
a few cases where proto_tree_add_uint_format_value could just be
proto_tree_add_uint.

Added a few more "common" unit string values to unit_strings.[ch]

Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d
Reviewed-on: https://code.wireshark.org/review/19242
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13 22:56:50 +00:00
Olga Kornievskaia e4fd25060e nfs: Fixing COPY decoding to match the spec
Current decoding of the COPY operation gets a netloc4 instead
of a stateid from the write_response4 structure.

Change-Id: Icde8adde8613d50e7a03ee779aad4c62f6f195f4
Reviewed-on: https://code.wireshark.org/review/18169
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-12 22:48:23 +00:00
Olga Kornievskaia c2b7a74c14 nfs: Fixing OFFLOAD_STATUS reply decoding
commit b5aa0ff1a4

    nfs: Add NFSv4.2 ops OFFLOAD_CANCEL and OFFLOAD_STATUS

As coded, the reply of the OFFLOAD_STATUS decodes a stateid.
However, in the spec, the reply is count and an array of
statuses. I propose the following fix to match the spec
for the OFFLOAD_STATUS.

Change-Id: Ibaddba96446b8d9b520ca977f0b1ed66749d3388
Reviewed-on: https://code.wireshark.org/review/17805
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-21 20:43:15 +00:00
Tom Haynes 1e3c57b486 nfs: Primary Data's NFSv4 DataSphere filehandle decoder
Change-Id: I0d339f69f37fd3b6a2f7b37b1c239edb2a4cf7a5
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/17676
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>
2016-09-13 19:04:08 +00:00
Jeff Layton 1948f7bd75 nfs: add dissector for CB_NOTIFY_LOCK args
Show the filehandle and lockowner for the callback.

Change-Id: Id09b260d4b31f8fa35ba8452dc143095e5cc88ec
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-on: https://code.wireshark.org/review/17574
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: Michael Mann <mmann78@netscape.net>
2016-09-09 03:00:58 +00:00
Alexis La Goutte ce2fa7b30a NFS: fix indent (remove some trailing spaces)
Change-Id: Ic72d264686c3b37ac15118eec07057c7bb8a2a50
Reviewed-on: https://code.wireshark.org/review/17422
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>
2016-08-31 16:56:00 +00:00
Tom Haynes a68fb134c7 nfs4: Handle CB_GETATTR
Change-Id: Ifb68af443c6f13dfab99e32488d86c148621a316
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/17399
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-08-31 04:46:57 +00:00
Tom Haynes 436ed87580 nfs: Fix style in switch
Change-Id: Ica9fc960946542badb64af12769e7dfa3793db82
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/17397
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-31 01:28:52 +00:00
Guy Harris a4c8ebc18b Don't do any Decode As stuff for dissector tables not used with Decode As.
Have all dissector tables have a "supports Decode As" flag, which
defaults to FALSE, and which is set to TRUE if a register_decode_as()
refers to it.

When adding a dissector to a dissector table with a given key, only add
it for Decode As if the dissector table supports it.

For non-FT_STRING dissector tables, always check for multiple entries
for the same protocol with different dissectors, and report an error if
we found them.

This means there's no need for the creator of a dissector table to
specify whether duplicates of that sort should be allowed - we always do
the check when registering something for "Decode As" (in a non-FT_STRING
dissector table), and just don't bother registering anything for "Decode
As" if the dissector table doesn't support "Decode As", so there's no
check done for those dissector tables.

Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed
Reviewed-on: https://code.wireshark.org/review/17402
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31 00:08:01 +00:00
Tom Haynes 8b705b3753 nfs: Standardize on FileHandle vs filehandle
Change-Id: Ib945ddee4a35bf984a9411e56ed3801cde70c6c4
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/17398
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-08-30 21:42:45 +00:00
Benjamin Coddington af52c8536f packet-nfs: fixup whitespace in pNFS SCSI work
A recent patch introduced whitespace errors.. clean them out.

Change-Id: Id67bed40646d60dc6775e1e1f958a5a07a5f5f6d
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-on: https://code.wireshark.org/review/16205
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: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-29 20:59:41 +00:00
Benjamin Coddington 45db2fbe1e packet-nfs: add extent decoding for SCSI layouts
Decode extents sent within the response to a LAYOUTGET operation on
SCSI layout types.

Change-Id: I1fc0a5e3d4782f078f96866dc63f2ec43b6d62b1
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-on: https://code.wireshark.org/review/16097
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-23 14:20:28 +00:00
Michael Mann b3514e8484 Create a "placeholder" NFS CB protocol for ONC-RPC stats.
In GTK GUI, "NFS" shows up twice in the ONC-RPC Service Response Time
Programs list.  That's probably confusing enough to users.  In Qt
the "second" NFS wasn't showing up at all (or getting overwritten)
because it was hashing on program name.
Make NFS programs unique with a "stubbed" protocol.

Bug: 12478
Change-Id: Ic4ebdab8ba8b70e6026e1fb0f8e8defd4532b0f2
Reviewed-on: https://code.wireshark.org/review/15587
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-27 13:30:32 +00:00
Tom Haynes 0766f78557 packet-nfs: Add flex file flag: FF_FLAGS_NO_READ_IO
Change-Id: I3c5895d2e0671cdcd8063aa27356d49aa2bdbfa7
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/15416
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Trond Myklebust <trondmy@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-05-13 19:22:05 +00:00
Tigran Mkrtchyan 1fca7767d0 packet-nfs: add decoding and displaying of exclusive create attributes
NFSv4.1 defines FATTR4_SUPPATTR_EXCLCREAT attribute which tells the client
a bitmap of attributes which can be set during exclusive create. Wireshark did
show that FATTR4_SUPPATTR_EXCLCREAT is provided, but doesn't show supported
attributes.

Bug: 12435
Change-Id: I29fc6beb2e75e9c78d68b1ca73a714bab2ad10a2
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Reviewed-on: https://code.wireshark.org/review/15401
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-12 15:46:26 +00:00
Pascal Quantin 9abbf8b69d Do not mix wmem and glib allocators
Change-Id: I0e845668a1b9dbec93ea920a8585ecfe60f001d1
Reviewed-on: https://code.wireshark.org/review/15044
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-22 04:32:32 +00:00
Benjamin Coddington 17ccb2cb44 packet-nfs: update GETDEVICEINFO op for pNFS SCSI
The pNFS SCSI layout type defines additional structures to be returned for
GETDEVICEINFO to refer to SCSI volumes.  Update packet-nfs.c to decode
these structures.  Only BASE volume types have been tested.

Change-Id: I8c6e283d6f98763ee505c7880dbc5ceac0e86675
Reviewed-on: https://code.wireshark.org/review/15016
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-04-21 10:06:42 +00:00
Benjamin Coddington 3eaa183fea packet-nfs: fix offset calculation for fs_layout_type
Change-Id: I4d0176938f977caffc09a96c44e081dbe7a0154c
Reviewed-on: https://code.wireshark.org/review/15014
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-04-20 21:36:30 +00:00
Benjamin Coddington 287aacf06a packet-nfs: fix layout_blksize label
Change-Id: I81c61b9e04bc787ce2afb90db2c83a37d4f5fd44
Reviewed-on: https://code.wireshark.org/review/15015
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-04-20 21:36:22 +00:00
Benjamin Coddington d3b86727e9 packet-nfs: enable nfs4.lock_owner4
Change-Id: I32e718a8ef94b514fd2907651e2f9bd92d8119ef
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-on: https://code.wireshark.org/review/14627
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: Michael Mann <mmann78@netscape.net>
2016-03-25 23:31:36 +00:00
Michael Mann e37275bfde Associate dissector tables and heuristic subdissector lists with a protocol.
This will make it easier to determine protocol dependencies.

Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used)

Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d
Reviewed-on: https://code.wireshark.org/review/14446
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17 00:05:17 +00:00
Tigran Mkrtchyan 7c15566fa1 packet-nfs: do not call g_hash_table_remove before g_hash_table_insert
The g_hash_table_insert will remove and deallocate existing entry, so we
don't need to do it at all.

Change-Id: I661cadd8beea9585885e48c03a8b52561d1df778
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Reviewed-on: https://code.wireshark.org/review/14113
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-02-24 11:56:43 +00:00
Tigran Mkrtchyan f897899f61 packet-nfs: fix double-free
fixes regression introduced by f5340b2

g_hash_table_remove will call free on object, thus there is no need for explicit g_free,
as is causes a double-free:

*** Error in `/usr/sbin/wireshark-gtk': double free or corruption (fasttop): 0x0000555556e6bf50 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x77da5)[0x7fffef80ada5]
/lib64/libc.so.6(+0x804fa)[0x7fffef8134fa]
/lib64/libc.so.6(cfree+0x4c)[0x7fffef816cac]
/lib64/libglib-2.0.so.0(g_free+0xe)[0x7ffff09665ee]
/lib64/libglib-2.0.so.0(+0x388ba)[0x7ffff094f8ba]
/lib64/libwireshark.so.6(+0x1cfb46b)[0x7ffff49d646b]
/lib64/libwireshark.so.6(+0x1d03d99)[0x7ffff49ded99]
/lib64/libwireshark.so.6(+0x173b11f)[0x7ffff441611f]
/lib64/libwireshark.so.6(+0x173bba5)[0x7ffff4416ba5]
/lib64/libwireshark.so.6(call_dissector_with_data+0x26)[0x7ffff4419ad6]

.....

The g_hash_table_insert will remove and deallocate existing entry, so we
don't need to do it at all.

Change-Id: Ide47d1f9deb3e1b0d8adefd31fc6f3bf5cbaa010
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Reviewed-on: https://code.wireshark.org/review/14096
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-02-24 11:56:13 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Trond Myklebust 9f5a0601a6 NFSv4.1 bugfixes
nfs: Fix up the SEQUENCE status flags
The SEQUENCE status flags are being displayed incorrectly (after the NFSv4
operations) due to being attached to the COMPOUND tree instead of the
SEQUENCE op's tree.

nfs/flexfiles: Ensure that we account for the layout_flags in the offset

nfs/flexfiles: Add a dissector for the optional layoutget "stats collect hint"
field

Change-Id: I8744254aa9f65a0b33510f2352875b01804149c2
Fixes: d892c32cc2 ("Eliminate proto_tree_add_text from packet-nfs.c")
Fixes: 79b88aacb6 ("nfs: Cleanup of FlexFiles Layout Type")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/13477
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-22 07:06:30 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
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: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
Pascal Quantin 8884edbbd6 NFS: fix crash when activating file_name_snooping option
gf5340b2 introduced a value destroy function.
When transfering a given value from nfs_name_snoop_unmatched to nfs_name_snoop_matched hash map, do not free the value automatically

Bug: 11972
Change-Id: I8c4e0db07084b041baf73ccf4d0788248574a9d8
Reviewed-on: https://code.wireshark.org/review/13115
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-08 12:12:21 +00:00
Guy Harris 5a60c0d72e Use wmem_memdup() instead of wmem_alloc() followed by memcpy().
This also fixes a case where, if nfs_fh->len wasn't a multiple of 4, the
allocated buffer was too short, by the difference between the next lower
multiple of 4 and nfs_fh->len, so the memcpy() went past the end of the
buffer.  (And, yes, an NFSv3 file handle can have a byte count that's
not a multiple of 4 - it's a variable-length opaque type - even if the
marshalled data is padded with 0s to a multiple of 4 bytes, as with
other XDR types.)

Change-Id: I689d4b365e8a1547428a1580884f66177dc5841b
Reviewed-on: https://code.wireshark.org/review/12964
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-31 21:26:53 +00:00
Olga Kornievskaia 05c47d755a [NFS] adding stateid hash based on stateid.other
In NFS protocol, stateid's seq# changes within the stateid and therefore
it changes the calculated hash of the stateid displayed by the wireshark.
It makes it inconvenient to filter packets based on such value.

This patches adds additional field (instead of replacing old) to display
the CRC32 hash of the stateid.other field.

Bug:11895
Change-Id: I70c6d2b88822b6f735e8bc506a1bfcb421f6ddb9
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Reviewed-on: https://code.wireshark.org/review/12536
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: Michael Mann <mmann78@netscape.net>
2015-12-18 13:22:54 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Michael Mann dcfea6a06d create_dissector_handle -> new_create_dissector_handle
This finalizes the transformation for dissectors.

Change-Id: Ie5986b72bb69a6e8779ca3f5e20a80357c9e6fea
Reviewed-on: https://code.wireshark.org/review/12122
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-25 13:15:11 +00:00
Michael Mann 799d6fd057 create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: I96aa9cf53533cbb07105aa400d42922baf3016b3
Reviewed-on: https://code.wireshark.org/review/11860
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-16 22:00:30 +00:00
Michael Mann 74541a9596 Don't allow multiple registrations of a protocol in dissector tables.
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing.

The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not.  It's just ENFORCED for Decode As.

Bug: 3949
Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127
Reviewed-on: https://code.wireshark.org/review/11405
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 12:39:40 +00:00