Commit graph

175 commits

Author SHA1 Message Date
Alexis La Goutte
aa65e8463e Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
svn path=/trunk/; revision=54416
2013-12-23 20:13:31 +00:00
Alexis La Goutte
b3a584d8dc Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
svn path=/trunk/; revision=54412
2013-12-23 20:12:39 +00:00
Guy Harris
a1c84e00de Get rid of a set-but-unused variable.
svn path=/trunk/; revision=54355
2013-12-22 11:15:35 +00:00
Guy Harris
fc7a77189d Add UCS-4 support, and use it.
Shuffle the character ENC_ values around a bit, keeping the Unicode
encodings together, moving the Windows code pages (only one for now)
after the ISO 8859 encodings, and putting "I can't believe it's not
ASCII!" at the end.

Fix some comment typoes, and update another comment, while we're at it.

svn path=/trunk/; revision=54351
2013-12-22 08:45:57 +00:00
Evan Huus
a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Evan Huus
24360c9951 Make sure all unused bits are 0 in bacapp, fixes uninitialized memory found by
valgrind.

svn path=/trunk/; revision=54077
2013-12-13 23:08:32 +00:00
Guy Harris
2d5c1c8689 Note that apparently some BACnet implementations misuse the "ANSI X3.4"
encoding for ISO 8859-1; this means that those strings won't be
correctly interpreted if they're interpreted as UTF-8.

svn path=/trunk/; revision=54069
2013-12-13 21:36:50 +00:00
Guy Harris
e1c994f55f It's ISO 8859-1, not "ISO 18859-1", at least according to ANSI/ASHRAE
Standard 135-2004.

Use tvb_get_string_enc() wherever possible.

svn path=/trunk/; revision=53840
2013-12-08 01:28:00 +00:00
Evan Huus
df1aec4a6b Remove old (2009) and no-longer-necessary compatibility macro.
svn path=/trunk/; revision=53527
2013-11-23 22:03:48 +00:00
Jakub Zawadzki
50aa247c72 Fix Bug #9457 Update BACnet vendor list
Based on attachment #12139 (diff for adding the table) by rtsking117,
but keep original formatting and encoding (ASCII).

svn path=/trunk/; revision=53457
2013-11-20 23:32:02 +00:00
Jakub Zawadzki
1899903f69 Include <epan/to_str.h> only when needed.
svn path=/trunk/; revision=53189
2013-11-09 13:41:10 +00:00
Bill Meier
9874da2fcb #if 0 numerous "unused const variables" (mostly value-string-arrays);
Also; fix a few "set but not used" warnings.

svn path=/trunk/; revision=52780
2013-10-23 06:29:11 +00:00
Bill Meier
a3a15ff90b Remove instances of unused 'data_handle' (and of one other handle).
svn path=/trunk/; revision=52767
2013-10-22 16:13:32 +00:00
Bill Meier
59277781ff Minor whitespace changes
svn path=/trunk/; revision=52590
2013-10-13 19:14:33 +00:00
Pascal Quantin
a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Bill Meier
7316284293 Reference 'BACnetVendorIdentifiers' value_string using
an extended value string.

svn path=/trunk/; revision=52124
2013-09-17 18:55:17 +00:00
Bill Meier
b7bb743641 Update 'BACnetVendorIdentifiers' value strings from
BACnet vendor ID list dated September 16, 2013.
http://www.bacnet.org/VendorID/BACnet%20Vendor%20IDs.htm


svn path=/trunk/; revision=52119
2013-09-17 16:44:26 +00:00
Jörg Mayer
0d1411f854 Add comment where the vendor ids come from
svn path=/trunk/; revision=52014
2013-09-13 17:40:32 +00:00
Pascal Quantin
6cedc2c336 Convert a few more dissectors to wmem
svn path=/trunk/; revision=51991
2013-09-12 22:03:31 +00:00
Michael Mann
9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Alexis La Goutte
4c81d15a4a Fix (-W)documentation error found by Clang
packet-bacapp.c:78:13: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tvb
   ~~~~~~~~~^
packet-bacapp.c:79:15: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param pinfo
   ~~~~~~~~~~~^
packet-bacapp.c:80:14: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tree
   ~~~~~~~~~~^
packet-bacapp.c💯13: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tvb
   ~~~~~~~~~^
packet-bacapp.c:101:15: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param pinfo
   ~~~~~~~~~~~^
packet-bacapp.c:102:14: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tree
   ~~~~~~~~~~^
packet-bacapp.c:103:16: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param offset
   ~~~~~~~~~~~~^
packet-bacapp.c:110:13: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tvb
   ~~~~~~~~~^
packet-bacapp.c:111:15: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param pinfo
   ~~~~~~~~~~~^
packet-bacapp.c:112:14: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tree
   ~~~~~~~~~~^
packet-bacapp.c:113:16: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param offset
   ~~~~~~~~~~~~^
packet-bacapp.c:130:13: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tvb
   ~~~~~~~~~^
packet-bacapp.c:131:15: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param pinfo
   ~~~~~~~~~~~^
packet-bacapp.c:132:14: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tree
   ~~~~~~~~~~^
packet-bacapp.c:133:16: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param offset
   ~~~~~~~~~~~~^
packet-bacapp.c:146:13: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tvb
   ~~~~~~~~~^
packet-bacapp.c:147:15: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param pinfo
   ~~~~~~~~~~~^
packet-bacapp.c:148:14: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param tree
   ~~~~~~~~~~^
packet-bacapp.c:149:16: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 * @param offset
   ~~~~~~~~~~~~^

packet-bacapp.c:251:15: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param label
   ~~~~~~~~~~~^
packet-bacapp.c:263:15: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param label
   ~~~~~~~~~~~^
packet-bacapp.c:275:15: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param label
   ~~~~~~~~~~~^
packet-bacapp.c:288:15: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param label
   ~~~~~~~~~~~^
packet-bacapp.c:300:15: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param label
   ~~~~~~~~~~~^
packet-bacapp.c:325:24: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param service_choice
   ~~~~~~~~~~~~~~~~~~~~^
packet-bacapp.c:338:24: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param service_choice
   ~~~~~~~~~~~~~~~~~~~~^
packet-bacapp.c:521:15: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param label
   ~~~~~~~~~~~^
packet-bacapp.c:522:13: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param src
   ~~~~~~~~~^
packet-bacapp.c:521:11: error: parameter 'label' not found in the function
      declaration [-Werror,-Wdocumentation]
 * @param label
          ^~~~~
packet-bacapp.c:522:11: error: parameter 'src' not found in the function
      declaration [-Werror,-Wdocumentation]
 * @param src
          ^~~
packet-bacapp.c:654:11: error: parameter 'tree' not found in the function
      declaration [-Werror,-Wdocumentation]
 * @param tree the tree to append this item to
          ^~~~
packet-bacapp.c:654:11: note: did you mean 'subtree'?
 * @param tree the tree to append this item to
          ^~~~
          subtree
packet-bacapp.c:723:11: error: parameter 'tree' not found in the function
      declaration [-Werror,-Wdocumentation]
 * @param tree the tree to append this item to
          ^~~~
packet-bacapp.c:723:11: note: did you mean 'subtree'?
 * @param tree the tree to append this item to
          ^~~~
          subtree
packet-bacapp.c:749:11: error: parameter 'tree' not found in the function
      declaration [-Werror,-Wdocumentation]
 * @param tree the tree to append this item to
          ^~~~
packet-bacapp.c:749:11: note: did you mean 'subtree'?
 * @param tree the tree to append this item to
          ^~~~
          subtree
packet-bacapp.c:1076:24: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param service_choice
   ~~~~~~~~~~~~~~~~~~~~^
packet-bacapp.c:1266:17: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param service
   ~~~~~~~~~~~~~^
packet-bacapp.c:1337:4: error: unknown command tag name 'pram'; did you mean
      'param'? [-Werror,-Wdocumentation]
 * @pram pinfo
   ^~~~~
    param
packet-bacapp.c:1337:14: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @pram pinfo
         ~~~~^
packet-bacapp.c:1366:15: error: empty paragraph passed to '@param' command
      [-Werror,-Wdocumentation]
 * @param label
   ~~~~~~~~~~~^

svn path=/trunk/; revision=51261
2013-08-10 21:28:59 +00:00
Jakub Zawadzki
a18172147f Remove fragment_data, add fragment_head, fragment_item - for now alias it to the same structure.
This is begin of work to split fragment head and fragments items.

svn path=/trunk/; revision=50708
2013-07-17 21:12:24 +00:00
Michael Mann
7878e93cad expert_add_info_format_text + proto_tree_add_text = proto_tree_add_expert_format, where applicable.
svn path=/trunk/; revision=50377
2013-07-03 23:43:26 +00:00
Michael Mann
5bbc26236a Batch of filterable expert infos.
Also added a note about deprecating expert_add_info_format

svn path=/trunk/; revision=50270
2013-06-30 22:19:37 +00:00
Guy Harris
a2414d8909 Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols
running atop TCP should be done on flows from one TCP endpoint to
another.

We do this by:

	adding "reassembly table" as a data structure;

	associating hash tables for both in-progress reassemblies and
	completed reassemblies with that data structure (currently, not
	all reassemblies use the latter; they might keep completed
	reassemblies in the first table);

	having functions to create and destroy keys in that table;

	offering standard routines for doing address-based and
	address-and-port-based flow processing, so that dissectors not
	needing their own specialized flow processing can just use them.

This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where
the second YPALL response is processed as if it were a continuation of
a previous response between different endpoints, even though said
response is already reassembled), and also allows the DCE RPC-specific
stuff to be moved out of epan/reassembly.c into the DCE RPC dissector.

svn path=/trunk/; revision=48491
2013-03-22 23:59:54 +00:00
Anders Broman
455f5c8243 - [-Wmissing-prototypes]
- explicit casts.

svn path=/trunk/; revision=48265
2013-03-12 20:00:50 +00:00
Alexis La Goutte
b9a0eaedae Fix indent (Tab => 4 Spaces) Remove whitespace And Modelines info
svn path=/trunk/; revision=47800
2013-02-21 15:32:29 +00:00
Alexis La Goutte
38655fbd2f Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=47799
2013-02-21 15:32:15 +00:00
Evan Huus
235a1eb09d From Lori Tribble via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8331
Fix UCS-2 string decoding for strings longer than 127 characters.

svn path=/trunk/; revision=47675
2013-02-15 16:59:20 +00:00
Evan Huus
47d20bf9be From Lori Tribble via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8306
Fix decoding the Loop Object Setpoint-Reference property in BACapp packets.

svn path=/trunk/; revision=47577
2013-02-09 01:32:19 +00:00
Anders Broman
84a94842a8 From "schlephorst":
BACnet dissect new tags in NotificationParameters.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8181

svn path=/trunk/; revision=47011
2013-01-10 06:48:10 +00:00
Anders Broman
c553ca5c5e From "schlephorst":
BACnet dissect new tags in EventParameters.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8181

svn path=/trunk/; revision=47010
2013-01-10 06:42:15 +00:00
Guy Harris
8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Evan Huus
2461373edd Remove unneeded variable initializers.
svn path=/trunk/; revision=46328
2012-12-02 15:21:53 +00:00
Jeff Morriss
2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jeff Morriss
aa5d9d78dd From Robert Bullen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7683 :
The reassembled fragments tree in the Packet Details view is awesome, but it
lacks one thing: a field that exposes the reassembled data.

tcp.data already exists for exposing a single TCP segment's payload as a byte
array. It would be handy to have something similar for a single application
layer PDU when TCP segment reassembly is involved. I propose
tcp.reassembled.data, named and placed after the already existing field
tcp.reassembled.length.

My primary use case for this feature is outputting tcp.reassembled.data with
tshark for further processing with a script.

The attached patch implements this very feature. Because the reassembled
fragment tree code is general purpose, i.e. not specific to just TCP, any
dissector that relies upon it can add a similar field very cheaply. In that
vein I've also implemented ip.reassembled.data and ipv6.reassembled.data, which
expose reassembled fragment data as a single byte stream for IPv4 and IPv6,
respectively. All other protocols that use the reassembly code have been left
alone, other than inserting NULL into their initializer lists for the newly
introduced struct field reassemble.h:fragment_items.hf_reassembled_data.

svn path=/trunk/; revision=44802
2012-09-07 02:09:59 +00:00
Bill Meier
638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +00:00
Jeff Morriss
3ab1e68751 From Lori Tribble via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7556 :
The BACnet GetEnrollmentSummary-ACK has an optional parameter Notification
Class.  The Wireshark decoding does not correctly decode when this parameter is
missing.

The fix is to verify the context exists before attempting to decode this
parameter.


From me: replace the few remaining tabs in the file with spaces.

svn path=/trunk/; revision=44207
2012-08-02 14:21:57 +00:00
Bill Meier
7eb2b89e71 From Lori Tribble:
Attached is a patch which corrects the string construction issue in the
PropertyStates method.  This patch also corrects a spelling error for
'utcTimeSyncronization' and adds decode support for this property.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6475#c8

svn path=/trunk/; revision=43868
2012-07-20 19:09:05 +00:00
Jakub Zawadzki
b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Bill Meier
1b17369504 Fix: code under 'if(tree)' (in)directly calls sub-dissector/col_...()/expert...() fcns
svn path=/trunk/; revision=43226
2012-06-12 21:22:46 +00:00
Anders Broman
859f794544 From Evan Huus:
Fix to
BACapp item length causes Buildbot crash output: randpkt-2011-04-13-1899.pcap

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

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

svn path=/trunk/; revision=42893
2012-05-29 07:31:38 +00:00
Chris Maynard
c47744e353 Fix dead initialization warning reported by clang.
svn path=/trunk/; revision=42323
2012-04-28 18:05:27 +00:00
Anders Broman
e966a129bd From Evan Huus:
Another case where a ridiculously large length field was causing a loop counter
to overflow. Had to pass pinfo all over the place to add expert info, but the
meat of the fix is on line 4960 (after patch applied).

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

svn path=/trunk/; revision=42203
2012-04-23 07:28:53 +00:00
Jakub Zawadzki
8a1dc57c03 Remove doubled semicolons and semicolons outside function.
svn path=/trunk/; revision=42053
2012-04-13 20:22:31 +00:00
Jakub Zawadzki
cbfa8a5de6 val is unitinialized when fUnsigned32 return false.
svn path=/trunk/; revision=41961
2012-04-05 20:17:39 +00:00
Jeff Morriss
1731fc958e From Martin Kaiser via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6977 :
The attached (trivial) patch adds some missing breaks in switch-case blocks.

This fixes coverity defects #445, #446, #1316 and #1380.

svn path=/trunk/; revision=41727
2012-03-21 22:18:15 +00:00
Bill Meier
63e3176881 Always test tvb_reported_length_remaining() return val for '> 0' instead of '!=0'
Also: Whitespace cleanup.

svn path=/trunk/; revision=41094
2012-02-21 02:02:11 +00:00
Bill Meier
9799f94861 Fix some [-Wunused-but-set-variable] warnings;
Trailing whitespace cleanup.

svn path=/trunk/; revision=39771
2011-11-09 01:35:26 +00:00
Stig Bjørlykke
f5c9ccd0c4 Fixed some coding errors:
packet-bacapp.c:6154: error: stray '\250' in program
packet-bacapp.c:7137: warning: cast to pointer from integer of different size

svn path=/trunk/; revision=39680
2011-10-30 17:03:24 +00:00