Commit Graph

40 Commits

Author SHA1 Message Date
Martin Mathieson b8a773dddc Fix some spelling errors in dissector strings.
A first batch of spelling errors, detected using a script that uses
pyspellcheck and a Wireshark-specific dictionary file.
2020-08-29 19:31:11 +00:00
Martin Mathieson b99dcf0593 Fix some issues seen with a fresh run of PVS Studio
/opt/SourceCode/wireshark/epan/dissectors/packet-aoe.c	328	warn	V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 323, 328.
/opt/SourceCode/wireshark/epan/dissectors/packet-aprs.c	1148	warn	V1037 Two or more case-branches perform the same actions. Check lines: 1148, 1161
/opt/SourceCode/wireshark/epan/dissectors/packet-lsd.c	127	err	V547 Expression 'strlen("cookie") == 0' is always false.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	3385	warn	V547 Expression 'conversation == NULL' is always true.
/opt/SourceCode/wireshark/epan/dissectors/packet-snort-config.c	465	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'g_snprintf' function. Under certain conditions the pointer can be null.
/opt/SourceCode/wireshark/epan/dissectors/packet-snort.c	630	warn	V768 The variable 'condition' is of enum type. It is odd that it is used as a variable of a Boolean-type.
/opt/SourceCode/wireshark/epan/dissectors/packet-snort.c	969	warn	V547 Expression '!attempt_match' is always false.

Bug: 16335
Change-Id: I93bbc40f0467ebaab74335f6edc7d60e1c600a94
Reviewed-on: https://code.wireshark.org/review/37044
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 00:26:33 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Jeff Morriss c3fc1e41c8 APRS: more cleanup.
There's no need to create global structures with pointers to the (global) hf's
to pass into the dissection functions.  Just reference the global variables
directly.

Remove other global variables passed as arguments while we're at it.

Remove boilerplate comments.

Change-Id: I7ce6b356172aa25983f4cc6a007a0158cb7f26c9
Reviewed-on: https://code.wireshark.org/review/16331
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-08 11:05:31 +00:00
Jeff Morriss 54bf3e90a9 APRS: clean up some header fields.
Try to make the names self-explanatory (without relying on blurbs).

Change-Id: Icfb4797282987b42ac68709b431d8b7248a0a633
Reviewed-on: https://code.wireshark.org/review/16330
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-08 10:58:17 +00:00
Jeff Morriss 166cedefbe APRS: register the storm fields.
There's been a comment here since 2012 about them being unregistered.  Put in
some registrations based on a feeble understanding of the specification (these
are all strings, add them as such); that should be close enough and is much
better than the (dissector) assertion we'd get otherwise.

Don't bother putting those hf's in a global structure and passing around the
structure: the hf's are global anyway--just reference them directly.

Add a link to the specification while we're here.

Change-Id: Ia7b17e92a996a1a8eb4a4489eff9fca042190a32
Reviewed-on: https://code.wireshark.org/review/16318
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-07 10:50:54 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
AndersBroman d2e880eab1 Replcae deprecated API tvb_length with tvb_reported_length or tvb_captured
length.

Change-Id: Ia1235c49b28320b5651e284115639820f81cb747
Reviewed-on: https://code.wireshark.org/review/8074
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-15 10:39:27 +00:00
Guy Harris d541774a61 Include <math.h> or <stdlib.h> as necessary to declare functions.
Various floating-point math functions require <math.h>, and abs()
requires <stdlib.h>.

Change-Id: Iadba9e0d7168bba6e67d9221e757a85960507742
Reviewed-on: https://code.wireshark.org/review/5999
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-22 21:24:15 +00:00
Martin Mathieson 596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +00:00
Michael Mann cdaa669829 Replace ax25_to_str and get_ax25_name with address_to_str.
Change-Id: I74ddb6fc629ef32b217dede7a3ba652cbbf5ab12
Reviewed-on: https://code.wireshark.org/review/5932
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21 15:12:58 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +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 9b181b97c6 Add editor modelines; Adjust whitespace; Remove boilerplate comments
Change-Id: I1f5f83ed441f6009125cf2cbe5023af04986898a
Reviewed-on: https://code.wireshark.org/review/4392
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-30 21:06:37 +00:00
Michael Mann 188aa9a80e convert to proto_tree_add_subtree[_format]
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df
Reviewed-on: https://code.wireshark.org/review/2560
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:07:16 +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
Guy Harris 1bfe396ca4 Get rid of some uses of tvb_get_ptr().
Change-Id: Ib49575e5d92419e0860bf92810a7ac69f30e9699
Reviewed-on: https://code.wireshark.org/review/1646
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 03:02:02 +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
Guy Harris 6dcce1fb9b Use tvb_get_string_enc() rather than tvb_get_string(). The specs say
ASCII, but there's a proposal to use UTF-8.

svn path=/trunk/; revision=54921
2014-01-23 01:45:55 +00:00
Guy Harris f7b0675bc6 Clean up references to an address and squelch some warnings.
svn path=/trunk/; revision=54754
2014-01-14 02:30:05 +00:00
Jakub Zawadzki 4d92f6079b Remove not needed ';'
svn path=/trunk/; revision=54088
2013-12-14 11:12:20 +00:00
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

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


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +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 efe18f199c Convert a few dissectors from emem to wmem API
svn path=/trunk/; revision=51983
2013-09-12 20:37:30 +00:00
Anders Broman 27fc641a79 - [-Wmissing-prototypes]
- explicit casts.

svn path=/trunk/; revision=48274
2013-03-12 23:09:37 +00:00
Bill Meier 6549fbbad7 #if 0 unused hf[] entries & etc.
Note: All (or almost all) unused hf[] entries
       in non-generated Wireshark dissectors
       have been #if 0'd (or commented) out.
       (This applies only to 'static hf_...' vars).
      A number of (non-generated) dissector
       files with *missing* hf[] entries
       still need to be fixed.


svn path=/trunk/; revision=47459
2013-02-03 22:29:48 +00:00
Guy Harris e2b61c828f Constify some character pointer variables to avoid warnings about
strings being assigned to them.

svn path=/trunk/; revision=46653
2012-12-21 05:34:38 +00:00
Bill Meier 7b69816cbb Fix 2 [-Wshadow] warnings
svn path=/trunk/; revision=46377
2012-12-04 19:24:28 +00:00
Bill Meier 84f5f91022 Fix [-Wunused-but-set-variable] warnings.
svn path=/trunk/; revision=45803
2012-10-26 21:47:02 +00:00
Bill Meier 31b1b3780c General cleanup (No changes in dissection):
- rename variables to fix all "shadowed variable" warnings;
- remove certain 'if(tree)' statements;
   (A new-style dissector) should return the same
    'bytes processed' whether or not 'tree == NULL');
- simplify code in numerous places (including removing
   redundant/repeated code);
- fix remaining uses of FALSE as 'encoding' arg;
- use consistent indentation and formatting.

ToDo: Changes to fix apparent cases of incorrect
      dissection.

svn path=/trunk/; revision=45802
2012-10-26 21:17:33 +00:00
Bill Meier 78494ccbbf Fix some encoding args; (still more to do).
svn path=/trunk/; revision=45730
2012-10-22 21:40:06 +00:00
Bill Meier 19d2c33091 Cleanup:
- Ethereal --> Wireshark;
- gerald@ethereal.com --> gerald@wireshark.org;
- update FSF address;
- remove unneeded #includes;
- Fix ENC args for proto_tree_add_item() & etc;
- simplify/remove proto_reg_handoff...() as appropriate;
- remove some boilerplate comments;
- move proto_register...() and proto_reg_handoff...() to
   the end of the file as per convention;
- remove some unneeded initializers.
- simplify some code;
- replace "" in hf[] blurb by NULL.


svn path=/trunk/; revision=45728
2012-10-22 20:46:47 +00:00
Alexis La Goutte 8d6260628e Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=45397
2012-10-08 17:54:39 +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 f99e04f2b0 Replace blurbs which duplicate the field name with NULL.
svn path=/trunk/; revision=44244
2012-08-03 14:44:44 +00:00
Guy Harris bf742abb62 Squelch narrowing warnings.
svn path=/trunk/; revision=44233
2012-08-03 00:23:27 +00:00
Guy Harris 1b876c36f1 Oops, forgot to add packet-aprs.c to dissector source lists.
Fix warnings in packet-aprs.c.

svn path=/trunk/; revision=44231
2012-08-02 23:53:38 +00:00
Guy Harris bafaa14059 From Richard Stearn: APRS support.
Fix field names for AX.25 "No layer 3" to match the protocol name.

svn path=/trunk/; revision=44230
2012-08-02 22:40:02 +00:00