Commit Graph

115 Commits

Author SHA1 Message Date
Chris Maynard 5debb5c5e3 Fix memory leaks involving tvb_get_string[z]().
svn path=/trunk/; revision=40312
2011-12-28 16:36:57 +00:00
Bill Meier 6c809fc444 In certain cases, don't reference a tvb when displaying a hidden,generated field.
svn path=/trunk/; revision=40208
2011-12-15 16:01:25 +00:00
Bill Meier 13f09ee27f Fix a tvb memory leak;
Essentially: generate tvbuffs as needed; don't save them for later reuse
               with the result they are never freed.

Also:
- move a struct from packet-nfs.h to packet-nfs.c since it's only used locally;
- reformat some long lines.

svn path=/trunk/; revision=40205
2011-12-14 22:01:38 +00:00
Chris Maynard 91398db56b Append each op name to the operations sub-tree so you don't necessarily have to expand the tree to see which ops are present. I think it makes more sense to append the names here rather than at the top level which was done to resolve bug 6078, but for now, I leave them appended in both places.
svn path=/trunk/; revision=39837
2011-11-14 20:38:05 +00:00
Chris Maynard 23193d4747 In the unlikely case that there are no ops, don't append anything. Also, comma-separate them.
svn path=/trunk/; revision=39770
2011-11-08 23:08:12 +00:00
Jeff Morriss f5e838b602 Remove comma at the end of several enumerator lists.
svn path=/trunk/; revision=39700
2011-11-01 01:23:10 +00:00
Alexis La Goutte ece3e6d974 Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=39651
2011-10-28 11:20:19 +00:00
Bill Meier 20e3e0b5b5 Fix some proto_tree_add_item() encoding args;
In some files:
 Remove a few unneeded #includes;
 Do some whitespace/indentation cleanup

svn path=/trunk/; revision=39635
2011-10-27 15:59:12 +00:00
Bill Meier 54b72021bb Fix encoding arg for various fcn calls:
- proto_tree_add_bits_item
 - proto_tree_add_bits_ret_val
 - proto_tree_add_bitmask
 - tvb_get_bits
 - tvb_get_bits16
 - tvb_get_bits24
 - tvb_get_bits32
 - tvb_get_bits64


svn path=/trunk/; revision=39539
2011-10-24 19:57:53 +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
Anders Broman 4b85603c80 From Jeremy Jones:
Add support for decoding NFSv4.1 OP_BIND_CONN_TO_SESSION.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6182

svn path=/trunk/; revision=38306
2011-08-02 05:18:58 +00:00
Bill Meier b17543e2c0 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.
svn path=/trunk/; revision=38049
2011-07-15 19:07:25 +00:00
Stig Bjørlykke 27344a90fe Removed some unneeded assignments.
Found by clang.

svn path=/trunk/; revision=36698
2011-04-18 15:29:25 +00:00
Bill Meier 1667de16c5 Don't assign to a proto_item * if the value won't be used: Coverity 990;
Add some missing code: improves display of "main_opcode" field: Coverity 991, 993 & 994;
Fix bug introduced a while back: "changeinfo4" field details aren't displayed: Coverity 992;
Add missing code so READDIR (V4) details  are shown in a subtree (as presumably was originally intended);
Fix some indentation.

svn path=/trunk/; revision=36525
2011-04-08 20:06:56 +00:00
Stig Bjørlykke 0b8be02229 Use correct length for clientaddr4 callback address entry.
svn path=/trunk/; revision=36411
2011-03-31 11:01:06 +00:00
Ronnie Sahlberg f3512de0a9 remove some assignments we dont use
svn path=/trunk/; revision=36406
2011-03-30 03:39:58 +00:00
Ronnie Sahlberg feaf55330e Coverity 989
Remove some item=  assignments we dont need since we never use the value
of the created item.


svn path=/trunk/; revision=36269
2011-03-22 20:48:36 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Bill Meier b21ea034b6 Use value_string_ext fcns to access certain value_string arrays;
Sort certain value_string arrays to be in ascending numeric order;
Do minor whitespace cleanup and reformatting of long lines.

svn path=/trunk/; revision=34780
2010-11-04 21:30:42 +00:00
Bill Meier 209109c2fd Define some fcns & vars as static ...
svn path=/trunk/; revision=34458
2010-10-10 20:07:06 +00:00
Jeff Morriss 0ff5638f37 Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34227
2010-09-23 21:46:31 +00:00
Jeff Morriss 381664535b As suggested by Kovarththanan Rajaratnam in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3548 :
Clean up hf fields some more: mostly removing leading and trailing spaces from names and blurbs.

svn path=/trunk/; revision=34165
2010-09-21 03:14:49 +00:00
Jeff Morriss d643e0366a Remove check_col(). Clean up some spacing/indentation too.
svn path=/trunk/; revision=34142
2010-09-17 02:22:37 +00:00
Jeff Morriss f2cfa4e453 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5197 :
The NFS dissector (all versions) show access types that have not been requested
to be checked as "not allowed" in the call and reply.  This is incorrect and
misleading.  At present one must manually compare what was requested in order
to assess if access was actually denied for that type.  When there are hundreds
or thousands of these ACCESS requests in a capture, it is not possible or
practical to manually check each one.  

The submitted patch does the following:

* Passes the access mask in the call to the reply for comparison
* Adds filterable fields for each supported (v4) and access type
* Adds a pseudo field, nfs.access_denied
* Lists the access types to be checked in the summary and tree
* Separately lists the supported, denied, and allowed access types in the 
  summary and tree

The changes are applied to all NFS versions.


From me: a couple of small changes to make it compile without warnings.

svn path=/trunk/; revision=34141
2010-09-17 02:03:09 +00:00
Gerald Combs 436ab95472 From Cal Turney via bug 5209:
Decode of SETCLIENTID calls in the Windows x86 version fail with "[Dissector
bug, protocol NFS: STATUS_ACCESS_VIOLATION: dissector accessed an invalid
memory address]".  This error occurs in packet-nfs.c in
dissect_nfs_clientaddr4() where vars 'protocol' and 'universal_ip_address' get
stepped on following the call to scanf().  The b1-b10 vars are declared as
quint8.  While "hh" modifier used in the scanf() is documented in Linux to
correspond to an a signed/unsigned char arg, I cannot find a similar
designation in Windows (MSDN). The Windows C compiler interprets %hhu as
corresponding to a int16 rather than int8.

svn path=/trunk/; revision=34115
2010-09-14 15:43:19 +00:00
Bill Meier aa3ba1a1b5 From Alex Burlyga: Make hf_nfs_slotid4 useful again.
"hf_slotid4 is used for all possible slotid fields in sequence op. This patch
 separates them out and makes it useful for filtering."

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

svn path=/trunk/; revision=33601
2010-07-21 01:43:14 +00:00
Gerald Combs 46bd1dac98 Initialize a variable. Fixes bug 5026.
svn path=/trunk/; revision=33596
2010-07-20 17:16:42 +00:00
Gerald Combs 844e3e122a Use sscanf() to parse clientaddr4 instead of trying to parse it
ourselves. Add support for IPv6 addresses. Fixes bug 5019.

svn path=/trunk/; revision=33585
2010-07-19 21:47:51 +00:00
Bill Meier 40c1c5b28b From Ian Schorr: "NFSv4 COMMIT Calls not decoding"
NFSv4 COMMIT Requests are not decoded.  NFS "malformed packet" logic is
tripped.

This was a bug introduced with the changes in bug 4975.  The dissector
erroneously tries to decode 4 bytes past the end of the packet.

A patch is attached that fixes that, as well as adds "Offset" info in the Info
column for COMMIT calls.

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

svn path=/trunk/; revision=33478
2010-07-09 00:23:27 +00:00
Jeff Morriss 4522f9b0a4 Limit the number of operations to 128 (arbitrary number) to keep us from attempting to mallocate way too much memory. This fixes the fuzz failure reported in bug 4976.
svn path=/trunk/; revision=33456
2010-07-06 14:57:54 +00:00
Guy Harris 80c8a18da7 Use G_GINT64_CONSTANT() to make a 64-bit all-bits-set constant.
svn path=/trunk/; revision=33454
2010-07-06 09:51:28 +00:00
Guy Harris 39f85d188c No need to add a fake field with the opcode as a string - you can just
compare the real opcode field against a string.

svn path=/trunk/; revision=33452
2010-07-06 08:43:07 +00:00
Stig Bjørlykke 8f686e8af0 Try checking for G_MAXUINT64 instead of 0xffffffffffffffff.
svn path=/trunk/; revision=33451
2010-07-06 07:45:38 +00:00
Stig Bjørlykke 22056542a8 Fix the build on OSX.
svn path=/trunk/; revision=33449
2010-07-06 06:40:34 +00:00
Anders Broman 4a16e04cc0 Fix:
packet-nfs.c:699: warning: type defaults to 'int' in declaration of 'nfsv4_operation_tiers'

packet-nfs.c:9583: warning: unused variable 'saved_fh_hash'
packet-nfs.c:9580: warning: unused variable 'name'

svn path=/trunk/; revision=33448
2010-07-06 05:53:18 +00:00
Anders Broman 7bded303a4 Fix "checked api failed"
svn path=/trunk/; revision=33447
2010-07-06 05:46:52 +00:00
Anders Broman a13bf525a8 From Ian Schorr:
NFSv4 usability enhancements (Info column summaries, filterable fields).
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4975

svn path=/trunk/; revision=33442
2010-07-06 04:13:54 +00:00
Jeff Morriss 2ee1711957 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4831 :
Add the data read/write length to the NFS tree so it is filterable.

From me: don't bother incrementing the offset just to decrement it again.
Change the hf info a bit.

(Ideally the RPC dissector would add the length to the tree not as a text
item; that is left for future work.)

svn path=/trunk/; revision=33101
2010-06-05 00:25:46 +00:00
Bill Meier 80562f4620 From Cal Turney: The NFS FH hash (nfs.fh.hash) incorrectly matches multiple filehandles.
"The method used in packet-nfs.c to calculate a 32-bit hash representing the 
 32-byte filehandle is faulty in that the hash often matches multiple
 filehandles."

"This patch uses CRC-32 to calculate the hash.
 We (EMC GNS) have tested this patch for the past two years and we have not
 found a single case where the hash matched more than one filehandle."

See Bug #4839: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4839


svn path=/trunk/; revision=33079
2010-06-04 00:45:37 +00:00
Jeff Morriss fa15217ece From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4832 :
Add field 'nfs.ops.count' in the detail pane of NFSv4 calls and replies that
displays the number of operations in NFSv4 COMPOUND requests/replies.

From me: change the blurb wording a bit.

svn path=/trunk/; revision=33069
2010-06-03 02:23:36 +00:00
Jeff Morriss 6d1db36944 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4830 :
Display the fsid (filesystem ID) in decimal as well as hex in the "attributes"
section of the header in NFSv3/v4 replies.

svn path=/trunk/; revision=33068
2010-06-03 02:15:32 +00:00
Anders Broman 404e77beac From Ian Schorr:
NFS Dissector needs FH support for EMC Celerra.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4813

svn path=/trunk/; revision=33027
2010-05-31 05:13:27 +00:00
Ronnie Sahlberg 56bd4cd88e Update the dissection of NFSv3 SETATTR Mode bits and dissect each
individual bit with a display filter name.


svn path=/trunk/; revision=32238
2010-03-18 23:04:31 +00:00
Bill Meier a8a673ef42 Fix some indentation.
svn path=/trunk/; revision=31875
2010-02-13 16:28:32 +00:00
Bill Meier 629a186c14 From Mike Sager: NFS: parse RECLAIM_COMPLETE op
See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4469

svn path=/trunk/; revision=31874
2010-02-13 16:25:30 +00:00
Jaap Keuter a264038022 From Alex Burlyga:
Currently parsing of the Exchange_Id is technically correct but hard to read.
This patch updates display inline with data structures specified in RFC 5661.

svn path=/trunk/; revision=31805
2010-02-05 22:02:55 +00:00