Commit Graph

195 Commits

Author SHA1 Message Date
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +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
Jakub Zawadzki 0176a135db Propage changes done in generated dissectors to asn1/
svn path=/trunk/; revision=44845
2012-09-10 15:24:00 +00:00
Chris Maynard c38a247faa Fix Coverity CID 280019 (formerly 19): "Logically dead code" that abroman previously commited a fix for in r17532, but forgot to also commit a change to asn1/snmp/packet-snmp-template.c as well, so the change was apparently inadvertently reverted the next time that packet-snmp.c was regenerated.
svn path=/trunk/; revision=44179
2012-08-01 02:08:29 +00:00
Pascal Quantin 996e2f58b8 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7508 :
Display snmp.contextName as FT_STRING

svn path=/trunk/; revision=43883
2012-07-21 08:50:32 +00:00
Chris Maynard 4d180fbe32 tvb_length_remaining() can return -1, so don't assign its return value to an unsigned integer. Fixes Coverity CID's 280233 and 280234.
svn path=/trunk/; revision=43697
2012-07-13 20:47:08 +00:00
Pascal Quantin 1410207421 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7438 :
Do not call tvb_ensure_length_remaining on an empty tvb

svn path=/trunk/; revision=43648
2012-07-10 15:43:03 +00:00
Guy Harris 659cf0527a UATs could be put into "categories". The categories were defined only
implicitly by the #define name and string they were defined to; not all
UATs neatly fit into any of the categories, so some of them were put
into categories that weren't obviously correct for them, and one - the
display filter macro UAT - wasn't put into any category at all (which
caused crashes when editing them, as the GUI code that handled UAT
changes from a dialog assumed the category field was non-null).

The category was, in practice, used only to decide, in the
aforementioned GUI code, whether the packet summary pane needed to be
updated or not.  It also offered no option of "don't update the packet
summary pane *and* don't redissect anything", which is what would be
appropriate for the display filter macro UAT.

Replace the category with a set of fields indicating what the UAT
affects; we currently offer "dissection", which applies to most UATs
(any UAT in libwireshark presumably affects dissection at a minimum) and
"the set of named fields that exist".  Changing any UAT that affects
dissection requires a redissection; changing any UAT that affects the
set of named fields that exist requires a redissection *and* rebuilding
the packet summary pane.

Perhaps we also need "filtering", so that if you change a display filter
macro, we re-filter, in case the display is currently filtered with a
display filter that uses a macro that changed.

svn path=/trunk/; revision=43603
2012-07-08 01:00:46 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Chris Maynard 951b5b9c54 Do not use BASE_NONE for FT_*INT* types.
svn path=/trunk/; revision=43179
2012-06-09 17:56:08 +00:00
Anders Broman 2a30b1eff9 Get rid of a couple of warnings.
svn path=/trunk/; revision=43065
2012-06-04 13:21:44 +00:00
Chris Maynard 0c49176411 tvb_length_remaining() can return a negative number, so be sure to handle it. Fixes Coverity CID's 280233-280235.
svn path=/trunk/; revision=42839
2012-05-24 23:35:23 +00:00
Jakub Zawadzki c09a95a0e3 Fix bug #7283
When Engine ID is 128 we should only break when we know the enterprise id.

svn path=/trunk/; revision=42825
2012-05-24 12:26:34 +00:00
Guy Harris 7b4894e3ed Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.

svn path=/trunk/; revision=42556
2012-05-11 03:28:26 +00:00
pascal 1cd8ca08a6 From Evan Huus:
Fix Integer32 length field detection
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7192

svn path=/trunk/; revision=42241
2012-04-25 20:20:23 +00:00
Chris Maynard 86cbd0b559 #include <epan/crypt/crypt-*.h> => #include <epan/crypt/*.h>
svn path=/trunk/; revision=40570
2012-01-18 21:20:50 +00:00
Anders Broman 42b44648c8 Get rid of Warnings.
svn path=/trunk/; revision=39954
2011-11-20 08:59:19 +00:00
Guy Harris bbed650915 Do some more length checking to avoid a dissector bug error. Should fix
bug 6564.

svn path=/trunk/; revision=39831
2011-11-14 18:42:11 +00:00
Stig Bjørlykke be353072dc Added support for big integer64 values.
This fixes bug 6295.

svn path=/trunk/; revision=39666
2011-10-29 18:26:57 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 54716c768a Use ENC_NA as proto_tree_add_item() encoding arg for FT_ETHER hf[] field type.
svn path=/trunk/; revision=39491
2011-10-20 14:36:14 +00:00
Bill Meier 31abdcb584 Convert asn1 template files proto_tree_add_item() 'encoding' arg for field types FT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. Always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).

svn path=/trunk/; revision=39428
2011-10-15 19:48:19 +00:00
Jeff Morriss cf012d27b1 Build the ASN.1 dissectors directly into epan/dissectors (rather than building
them and then copying them over).  The "all" target to builds these dissectors
now (instead of "generate_files" and/or "copy_files").

asn2wrs's "-O" option now means "the dissector goes in this directory" (rather
than "all output goes in this directory"); it also means that the "-s" (single
output file) option is now required.

Fix things up so that it's possible to build all of the ASN.1 dissectors in
one shot.

Fix building of conformance files when doing out-of-source-tree builds.


Unfortunately "make all" in the asn1 directory always builds something--I think
because of circular depedencies.

svn path=/trunk/; revision=39333
2011-10-10 02:31:11 +00:00
Bill Meier 6142dd287b Convert 'encoding' parameter of certain proto_tree_add_item() calls in asn1/*:
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_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

 Also: For type FT_IPv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39332
2011-10-10 01:38:20 +00:00
Bill Meier e18e2694c6 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|1|0|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN
 

svn path=/trunk/; revision=39263
2011-10-05 02:39:04 +00:00
Gerald Combs 44332d7279 Change the case of "sNMPv2-Trap" to match RFC 3416. Reported by Qiyao.
svn path=/trunk/; revision=39114
2011-09-23 22:44:28 +00:00
Chris Maynard b25c098e0c From Paul Stath via bug 5731: The check for engineID length should only occur if the engineID has a non-zero length.
Reference: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5731

svn path=/trunk/; revision=38303
2011-08-02 01:54:03 +00:00
Stig Bjørlykke f282154ab0 Use correct encoding for proto_tree_add_item().
svn path=/trunk/; revision=38107
2011-07-19 10:51:12 +00:00
Anders Broman 2477298026 From Sean Van Gorder:
When Wireshark attempts to read an SNMP packet with a variable-bindings item
with an OID containing an index string which includes an entry of type
"Unsigned32", Wireshark will stop dissecting the packet at this index entry and
end with the error:

[Dissector bug, protocol SNMP: proto.c:2761: failed assertion
"DISSECTOR_ASSERT_NOT_REACHED"]

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

svn path=/trunk/; revision=37558
2011-06-05 20:12:44 +00:00
Alexis La Goutte ec7709406e Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36771
2011-04-21 16:00:38 +00:00
Alexis La Goutte 7239db18ec Fix Dead Store (Dead nested assignment) Warning found by Clang
svn path=/trunk/; revision=36760
2011-04-21 13:34:22 +00:00
Stephen Fisher fcfcfa347c Rollback r36614 and change dissect_SMUX_PDUs_PDU() to use previously
unused smux_tree instead of tree.  Per suggestion from Stig on -dev.


svn path=/trunk/; revision=36624
2011-04-13 15:48:24 +00:00
Stephen Fisher 4b416d92d0 Fix Coverity 524: NEGATIVE_RETURNS
Coverity sees that two calls to tvb_length_remaining() with an offset
of 0 may return -1 (for an "out of bounds" condition), which would lead
to an assignment of -1 to an unsigned variable and then passing it
to functions further down that cannot accept negative values.

Use tvb_ensure_length_remaining() to throw an exception in a case of
out of bounds access (though unlikely with an offset of 0) instead of
tvb_length_remaining(), which would return -1.


svn path=/trunk/; revision=36615
2011-04-12 22:23:03 +00:00
Stephen Fisher ce2eea5b95 Fix Coverity 1047: UNUSED_VALUE in dissect_smux
svn path=/trunk/; revision=36614
2011-04-12 22:12:05 +00:00
Stig Bjørlykke 42f41ddf0b Corrected switch-case flow.
Coverity 1184.

svn path=/trunk/; revision=36579
2011-04-12 09:05:43 +00:00
Gerald Combs f989235a87 Use a unique variable name. Fixes Coverity CID 593.
svn path=/trunk/; revision=36512
2011-04-07 23:52:37 +00:00
Jeff Morriss cc6fc23812 From Didier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3055 :
Apply rev 25869 to most of the rest of the TCP-desegmenting dissectors.
(The SSL dissector was already updated in one of two spots with bug 4535/rev
32456.)

A couple of the patches had to be manually applied.

From me: Fix the comments to match the change (including in the TCP and SSL
dissectors.)

svn path=/trunk/; revision=36332
2011-03-25 19:02:18 +00:00
Jaap Keuter 3ff6167958 Allow for expert items to be actually attached somewhere.
svn path=/trunk/; revision=35594
2011-01-20 08:58:03 +00:00
Stig Bjørlykke 011e451449 Only chop the last character (new line) from the error message.
svn path=/trunk/; revision=35310
2010-12-30 20:15:55 +00:00
Gerald Combs cf6df46095 Fix a buffer overflow in the engineId preferences. Fixes bug 5530.
svn path=/trunk/; revision=35298
2010-12-29 20:09:27 +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 03b57df5a0 Fix various typos and spelling errors.
svn path=/trunk/; revision=35126
2010-12-06 01:34:58 +00:00
Stig Bjørlykke c5bebaa771 One more:
Make the third argument to a UAT copy callback a size_t.

svn path=/trunk/; revision=34696
2010-10-29 21:55:04 +00:00
Stig Bjørlykke 340d64e780 Make the third argument to a UAT copy callback a size_t.
svn path=/trunk/; revision=34695
2010-10-29 21:51:59 +00:00
Jeff Morriss ebc190645f From Fulko Hew via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4615 :
The attached patch adds the missing decoded fields
by moving the proto_tree_add_item() call so that it
is no longer within an error handler and will be
called under normal circumstances (as well as error conditions.


From me: Apply the change to the ASN.1 source.  Also some white space
indentation cleanup.

svn path=/trunk/; revision=34505
2010-10-14 01:44:27 +00:00
Jeff Morriss 9ac49c557d Copy the rev 34143 changes to packet-snmp.c over to the asn1 source.
hf_snmp_engineid_enterprise is now a BASE_EXT_STRING, not BASE_RANGE_STRING.  This fixes
the fuzz failure in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5233 

svn path=/trunk/; revision=34151
2010-09-17 14:03:05 +00:00
Stig Bjørlykke f3d2b22899 Mark encryptedData as unused, to avoid warnings when not HAVE_LIBGCRYPT.
svn path=/trunk/; revision=33691
2010-08-02 08:52:39 +00:00
Stig Bjørlykke 33099036fe Added missing include <string.h>.
svn path=/trunk/; revision=33690
2010-08-02 08:46:36 +00:00
Guy Harris 63a0810874 oid_encoded2string() returns a const char *; don't assign it to a char
*.

Don't declare variables in the middle of a block; not all the compilers
we use support that.

svn path=/trunk/; revision=33409
2010-07-02 03:50:30 +00:00
Gerald Combs ad7b7cc679 Don't add raw bytes to the tree.
svn path=/trunk/; revision=33403
2010-07-01 17:57:53 +00:00