Commit Graph

72 Commits

Author SHA1 Message Date
Michael Mann a600ef6d59 Have media dissector take its "media type parameter" from dissector data parameter instead of pinfo->private_data.
Change-Id: I0a0cb0b4838bc4e55a759fb6031355892c220c8e
Reviewed-on: https://code.wireshark.org/review/5461
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-25 07:26:56 +00:00
AndersBroman f2fc562eda Replace tvb_length()
Change-Id: I0b5ad4d588f0b658abaf3892d08d6520ecd2f645
Reviewed-on: https://code.wireshark.org/review/5431
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-21 15:05:33 +00:00
Michael Mann f8e24c9fdc Eliminate proto_tree_add_text for some dissectors.
Change-Id: Ide14bcac0b1563bee4260ac9c1a280ba99e97e71
Reviewed-on: https://code.wireshark.org/review/5261
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>
2014-11-13 05:17:36 +00:00
Guy Harris 80e6f6251e Get rid of calls to ctype.h functions.
They don't handle values outside the range -1 to 127, and their behavior
is locale-dependent.  Use g_ascii_isXXX() and g_ascii_toXXX() instead of
isXXX() and toXXX().

If you're checking for printable ASCII, don't use isascii() and don't
use iscntrl(), use g_ascii_isprint().  If you're checking for graphical
ASCII, i.e. printable ASCII except for a space, use g_ascii_isgraph().

Use ws_xton() to convert a hex digit character to the corresponding
numeric value.

Change-Id: Id3039bc586fbf66d8736c2df248c790c0d7a2330
Reviewed-on: https://code.wireshark.org/review/4851
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-20 06:15:19 +00:00
Bill Meier 3c0a6681e8 Add editor modelines and adjust indentation as needed.
Change-Id: I857700d685354b0bc9e0ca647c57faba981b520f
Reviewed-on: https://code.wireshark.org/review/4373
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-29 18:50:46 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Jakub Zawadzki 1b439df610 Use proto_tree_add_format_text()
Change-Id: Ie111c4db4afd0702f5a016da1547486631f571d8
Reviewed-on: https://code.wireshark.org/review/1818
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-27 23:55:27 +00:00
Martin Kaiser 843054ce96 no need for if(tree)
Change-Id: If95ece8e2db1b650de5804465128020caf391956
Reviewed-on: https://code.wireshark.org/review/828
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-25 20:38:50 +00:00
Martin Kaiser 027ecfb658 use wmem_ascii_strdown()
Change-Id: Iaa7dfdc979e78f53b53f2b9a0b093873c9004f2d
Reviewed-on: https://code.wireshark.org/review/827
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-25 20:38:33 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Jakub Zawadzki 576c7eae45 Move base64_to_tvb() to tvbuff_base64.c
svn path=/trunk/; revision=54325
2013-12-21 14:33:54 +00:00
Jakub Zawadzki 715e2d6699 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54095
2013-12-14 16:09:57 +00:00
Michael Mann 02a8391535 Require dissector_try_string to pass a data parameter to its subdissectors. There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new.
svn path=/trunk/; revision=53049
2013-11-02 15:52:25 +00:00
Alexis La Goutte 925cba4e91 Fix build (missing some _U_)
svn path=/trunk/; revision=53048
2013-11-02 13:31:24 +00:00
Michael Mann 872f3efeca Prep a few more dissectors to receive their string data through dissector data.
svn path=/trunk/; revision=53045
2013-11-02 13:05:58 +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
Pascal Quantin 7850883904 emem -> wmem
svn path=/trunk/; revision=52063
2013-09-15 15:11:11 +00:00
Jakub Zawadzki c850c0bfc8 Fix memleak, base64_to_tvb() strdup passed string by its own.
svn path=/trunk/; revision=50729
2013-07-18 17:31:34 +00:00
Alexis La Goutte 484bf76753 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50236
2013-06-29 21:59:35 +00:00
Anders Broman 84241f46ad From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48399
2013-03-18 20:44:36 +00:00
Bill Meier 0c2e7dbe06 Use "4 space" indentation.
svn path=/trunk/; revision=47303
2013-01-26 19:09:15 +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
Michael Mann 5dd7371960 more ephemeral memory cleanup
svn path=/trunk/; revision=44496
2012-08-14 17:58:41 +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 d53320919a Remove unneeded #includes (stdlib, stdio, ctypes, time);
In a few cases: do some whitespace, indentation cleanup & reformatting.

svn path=/trunk/; revision=42632
2012-05-15 19:23:35 +00:00
pascal ce8f5a4334 From Evan Huus:
Fix memory leak in process_body_part() when there is no body
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7212

svn path=/trunk/; revision=42350
2012-04-30 15:57:39 +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 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00
Stig Bjørlykke 27d50a084a Added media type multipart/report from RFC3462.
svn path=/trunk/; revision=39298
2011-10-06 19:26:21 +00:00
Anders Broman 14fbabcb26 Get rid of check_col() and use ENC.
svn path=/trunk/; revision=39153
2011-09-26 17:50:54 +00:00
Bill Meier 26c721b7c9 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings;
Also: whitespace cleanup.

svn path=/trunk/; revision=37718
2011-06-19 19:13:26 +00:00
Jaap Keuter b67c9b05cb Supply an entry to use for unknown multipart subtype.
svn path=/trunk/; revision=34657
2010-10-27 06:48:39 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Bill Meier c5614625ee Fix some gcc -Wshadow warnings ....
svn path=/trunk/; revision=31559
2010-01-18 23:16:10 +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 c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Gerald Combs 60d3b45792 More size_t casts/fixes, and string buffers.
svn path=/trunk/; revision=27968
2009-04-06 00:08:46 +00:00
Bill Meier 808a4e2c3c Define certain fcns as static (if not used externally).
Also: whiule we're at it: 
 - fix hf[] blurbs as appropriate to use NULL;
 - fix some indentation

svn path=/trunk/; revision=27890
2009-03-29 22:16:26 +00:00
Stig Bjørlykke 62f60df6b4 From Jakub Zawadzki (bug 3331):
g_free() is NULL safe, so we don't need check against it.

svn path=/trunk/; revision=27718
2009-03-13 22:06:48 +00:00
Bill Meier a042c3aedd Small changes related to proto_register & proto_reg_handoff
- Move find_dissector_table(...) to proto_reg_handoff;
 - Use dissactor_add_handle instead of registering the dissector to tcp port 0;
 - Use find_dissector when appropriate.


svn path=/trunk/; revision=26767
2008-11-13 01:31:57 +00:00
Anders Broman 86e0bde995 packet-multipart.c:179: warning: unused parameter 'pinfo'
packet-multipart.c:179: warning: unused parameter 'name'
( restore a bit of previous code)
Move inclusion of tvbuff.h to base64.c

svn path=/trunk/; revision=25909
2008-08-03 15:44:26 +00:00
Anders Broman 2b9d63a4b5 Move common code to base64.c
svn path=/trunk/; revision=25908
2008-08-03 14:27:22 +00:00
Anders Broman 63c5c71cf8 Remove:
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
#endif

svn path=/trunk/; revision=24859
2008-04-09 05:36:08 +00:00
Stephen Fisher 726a1caaf1 - Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
  g_strsplit code for the no longer supported GLIB1 builds


svn path=/trunk/; revision=24829
2008-04-07 05:22:54 +00:00
Guy Harris 9c89cdaaa3 strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est.  Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our
own versions if they're missing from GLib (as is the case with GLib
1.x).

In the code to build the list of named fields for Diameter, don't use
g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping
in the hash function and use g_ascii_strcasecmp() in the compare
function.

We do this because there is no guarantee that toupper(), tolower(), and
functions that use them will, for example, map between "I" and "i" in
all locales; in Turkish locales, for example, there are, in both
upper case and lower case, versions of "i" with and without a dot, and
the upper-case version of "i" is "I"-with-a-dot and the lower-case
version of "I" is "i"-without-a-dot.  This causes strings that should
match not to match.

This finishes fixing bug 2010 - an earlier checkin prevented the crash
(as there are other ways to produce the same crash, e.g. a bogus
dictionary.xml file), but didn't fix the case-insensitive string matching.

svn path=/trunk/; revision=23623
2007-11-27 18:52:51 +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
Anders Broman 6c161ff927 Packet-imf.c - Offset must be advanced to AFTER CRLF(CRLF).
packet-multipart.c - imf_find_field_end()'s maxlength is last offset in tvb.

svn path=/trunk/; revision=22476
2007-08-09 12:17:56 +00:00