Commit Graph

63 Commits

Author SHA1 Message Date
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
Guy Harris 0cc027cc26 Note why strlen(args) could be < linelen.
Change-Id: I8fb3c35be0aa80895b8a917af8a9fd2542fbd9d6
Reviewed-on: https://code.wireshark.org/review/4393
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-30 21:32:59 +00:00
Martin Kaiser 514c101cb1 correct the line length if it was longer than the actual string supplied
by the caller

Bug: 10516
Change-Id: Ib2c9ab449b95da92cc889d0992fad30f432a2836
Reviewed-on: https://code.wireshark.org/review/4386
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-09-30 21:13:14 +00:00
Michael Mann a22b7075f8 Eliminate proto_tree_add_text from some dissectors.
Change-Id: I6f1710a093fc548c718defa9b40ab68877ede977
Reviewed-on: https://code.wireshark.org/review/3470
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-08 05:51:52 +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
Jakub Zawadzki d7bd2ecf9f Add new proto_tree_add_format_text() function
There are lot of text dissectors which want just to add escaped (not filtrable) text,
add new function proto_tree_add_format_text() which just do this in optimized way.

Change-Id: Ia0e189b620cc0a5b74cfdaef1ad4571d766bb2ab
Reviewed-on: https://code.wireshark.org/review/1678
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-19 02:27:12 +00:00
AndersBroman 3157bf6ba5 isprint() -> g_ascii_isprint()
Change-Id: Ia586ef8ce500d5fc7578c52014206fa7a7eaea41
Reviewed-on: https://code.wireshark.org/review/1624
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:14:07 +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 4cf7cdd387 fix some warnings.
svn path=/trunk/; revision=54334
2013-12-21 17:34:41 +00:00
Jakub Zawadzki 1fbc6102dc include header file.
svn path=/trunk/; revision=54331
2013-12-21 16:22:44 +00:00
Jakub Zawadzki 3d6fdc55d0 New functions: str_to_ip6(), str_to_ip()
This way we can avoid including lot of system header files in some dissectors
and it might fix bug #9581

svn path=/trunk/; revision=54330
2013-12-21 16:16:56 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Chris Maynard e45b95fa02 Try to appease Visual Studio Code Analysis to avoid a false warning (as far as I can tell), namely: warning C6054: String 'forbidden' might not be zero-terminated
svn path=/trunk/; revision=54009
2013-12-13 02:04:39 +00:00
Bill Meier 721b5d266a Do one or more of the following:
- Convert "4 space tabs" to spaces;
- Remove some unneeded initializers;
- 'offset++' --> 'offset += 1' for consistency;
- Reformat hf[] entries;
- Rework/add whitespace;
- Adjust editor modelines (set tab-width to 8).

svn path=/trunk/; revision=54005
2013-12-13 00:44:32 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Martin Kaiser a17cf67635 emem -> wmem
svn path=/trunk/; revision=52044
2013-09-14 18:30:43 +00:00
Chris Maynard 91ecc2334f "man inet_pton" only says that it returns a negative value, zero or a postive value, and not specifically -1, 0, or 1, so even though we know that's what wsutil's inet_pton will return, we shouldn't test against those exact values.
svn path=/trunk/; revision=50670
2013-07-16 16:23:31 +00:00
Michael Mann 5bc22a25df Batch of filterable expert infos.
svn path=/trunk/; revision=49584
2013-05-26 03:29:07 +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
Martin Kaiser 3ccd739fc6 removed a last if (tree) check in dissect_ftpdata()
svn path=/trunk/; revision=46460
2012-12-07 22:00:56 +00:00
Martin Kaiser dbaf194b10 EPRT parameters are mandatory, flag up an error if they're missing
remove if (linelen!=0) check

svn path=/trunk/; revision=46459
2012-12-07 21:54:20 +00:00
Martin Kaiser cf032504d3 remove some more if (tree) checks
svn path=/trunk/; revision=46457
2012-12-07 21:50:22 +00:00
Martin Kaiser 6a6babe5b0 at one place, offset was incremented depending on if (tree)
this created a bug when offset was used later on
remove the if (tree) check

svn path=/trunk/; revision=46456
2012-12-07 21:46:59 +00:00
Martin Kaiser 48f3309e14 dissect_ftp() start at the beginning of the tvb
make this clear by not using a variable offset which is always 0

svn path=/trunk/; revision=46455
2012-12-07 21:42:30 +00:00
Martin Kaiser 8f81b0fafe remove some more unnecessary if (tree) checks
svn path=/trunk/; revision=46454
2012-12-07 21:37:50 +00:00
Martin Kaiser 43f3eb63dc remove some unnecessary if (tree) checks in the ftp dissector
svn path=/trunk/; revision=46452
2012-12-07 21:31:03 +00:00
Martin Kaiser bbe9e06964 fix compliation on Win64
svn path=/trunk/; revision=45780
2012-10-24 21:45:50 +00:00
Martin Kaiser b60c69dc14 From Alexander Koeppe
parse EPSV response

from me
- no expert info under if(tree)
- use hf_ftp_epsv_port instead of hf_ftp_pasv_port
- don't use isdigit(), this is C99
- use temporary variable for IPv4 address

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

svn path=/trunk/; revision=45778
2012-10-24 20:59:27 +00:00
Martin Kaiser c44fadc3a8 From Alexander Koeppe
use inet_pton() for address parsing in FTP's EPRT command
support IPv6 addresses

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

svn path=/trunk/; revision=45565
2012-10-15 20:48:22 +00:00
Martin Kaiser e8205fb955 From Alexander Koeppe
support for EPRT command as defined in RFC 2428 (IPv4 addresses only)

from me
simplify the code, expert info must not be under if(tree)

based on the submission in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7729

svn path=/trunk/; revision=45308
2012-10-04 14:35:09 +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
Martin Kaiser cc9feb9857 fix compilation on Win7x64 (I hope)
svn path=/trunk/; revision=44783
2012-09-05 20:31:52 +00:00
Martin Kaiser 45af5d6a2d add modelines for the ftp dissector
svn path=/trunk/; revision=44782
2012-09-05 20:08:09 +00:00
Martin Kaiser fd919c30cb from Alexander Koeppe
ftp PASV and PORT commands: mark ip address and port in data view

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


svn path=/trunk/; revision=44781
2012-09-05 19:51:57 +00:00
Martin Mathieson 248b758f82 Now check the first few bytes of the ftp-data segment to see if it looks
printable.  If binary, just show the number of bytes in summary.

Not that there are no items inside it, don't create ftp-data as a tree.
Also, fix the type of the variable 'ti'.

svn path=/trunk/; revision=43929
2012-07-23 14:40:05 +00:00
Martin Mathieson 7abae04478 Calling tvb_format_text() for binary data segments (c1400 bytes) was
*very* slow (in a profiled run where FTP data is carried over LTE
MAC/RLC/PDCP/IP/TCP, this one function call was 20% of overall runtime).

Have limited to call to ITEM_LABEL_LENGTH, as that is all that
will be displayed anyway.  As per comment, I'm not convinced that doing
this for binary FTP data segments is worthwhile at all.  It doesn't
even display as hex.

svn path=/trunk/; revision=43908
2012-07-22 04:44:16 +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
Martin Mathieson f0b6f7a6ae Avoid assignement and clang warning.
svn path=/trunk/; revision=42317
2012-04-28 16:48:11 +00:00
Bill Meier ddecd24d5b Use a value_string_ext to reference a value_string array;
Use consistent indentation;
Reformat some lines.

svn path=/trunk/; revision=41640
2012-03-18 14:58:38 +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
Jakub Zawadzki beca9ba57a Remove not needed forward declaration.
svn path=/trunk/; revision=37759
2011-06-23 08:23:39 +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
Stig Bjørlykke 4a69d9203d Corrected pointer types to avoid warnings from clang.
svn path=/trunk/; revision=34773
2010-11-04 11:25:40 +00:00
Martin Mathieson a5532739d6 Remove a few more calls to check_col()
svn path=/trunk/; revision=34124
2010-09-15 16:16:23 +00:00
Bill Meier de4c6ff515 Fix a number of gcc _Wshadow warnings
svn path=/trunk/; revision=31557
2010-01-18 21:49:47 +00:00
Anders Broman 88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +00:00
Jaap Keuter 288927bc46 Adding RFC 2228 FTP replies.
svn path=/trunk/; revision=30623
2009-10-19 21:22:23 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00