Commit Graph

132 Commits

Author SHA1 Message Date
João Valverde dcc02b1003 dissectors: Replace g_log() with ws_log() 2021-06-16 12:50:28 +00:00
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
Guy Harris 3c7d381f84 dcom: fix typo ("rountine" -> "routine").
Change-Id: I6483a24866fdc9449c43e356dd1d3b8c6c354010
Reviewed-on: https://code.wireshark.org/review/38034
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-08-02 21:21:28 +00:00
liningjie 48fdd08237 dcom: free data_marshalers and set it to null when we change capture files.
Bug: 16746
Change-Id: I5893979ff90f061c773a5dfcfa1ceb7ee71901ba
Reviewed-on: https://code.wireshark.org/review/38030
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-08-02 20:50:29 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +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
alexsirr da848399ef DCOM - Add dissector for IProvideClassInfo
Bug: 15508
Change-Id: Ief643578407f202ebf501d67e4a55e70317db0ca
Reviewed-on: https://code.wireshark.org/review/32034
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-16 06:46:11 +00:00
alexsirr 3f95e31026 DCOM - Add dissector for ITypeInfo
Bug: 15646
Change-Id: I6476c3fd8bf928e865fc2ced5b70b49e9a2bacd7
Reviewed-on: https://code.wireshark.org/review/32591
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-04-06 07:25:21 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +00:00
Peter Wu ec6ace066a DCOM: always NUL-terminate dissect_dcom_BSTR results
All of the six users in plugins/epan/profinet/packet-dcom-cba.c expect
the string to be NUL-terminated, so ensure this to avoid reading
uninitialized memory for the Info column.

Bug: 15130
Change-Id: Ibc922068d14b87ce324af3cec22a5f8343088b40
Reviewed-on: https://code.wireshark.org/review/30128
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-12 05:09:00 +00:00
Dario Lombardo 692cef88c7 dissectors: more SPDX license convertions.
Change-Id: I96e1f1cdbaaf49d65705ecacc903f73cf0e47d7c
Reviewed-on: https://code.wireshark.org/review/26334
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-03-07 17:18:47 +00:00
João Valverde 90644c8372 Remove inet_aton() usage everywhere
Including where it says not to in comments. Use IPv4 dotted-decimal
notation.

Change-Id: Iafe1f6fbd2bd5867c41642dc27411f47dff8ce6a
Reviewed-on: https://code.wireshark.org/review/24044
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-25 19:10:57 +00:00
Alexis La Goutte 909fa66435 dcom: fix 'pinfo' was marked unused but was used [-Werror,-Wused-but-marked-unused]
Change-Id: Iabe002120dd25382be1c59cdf7d544a8c3629847
Reviewed-on: https://code.wireshark.org/review/14975
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-18 11:22:12 +00:00
João Valverde e4c059f67f Add free_address_wmem(), fix warnings [-Wcast-qual]
Try to improve address API and also fix some constness warnings
by not overloading the 'data' pointer to store malloc'ed buffers
(use private pointer for that instead).

Second try, now passing test suite.

Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f
Reviewed-on: https://code.wireshark.org/review/13946
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-26 23:09:43 +00:00
João Valverde 2e85975fee Just #include wsutil/inet_aton.h
No need for platform-specific system header boilerplate.

Change-Id: I5387a0005ddb0d7aab3c5b9f28d6282053c1b0fd
Reviewed-on: https://code.wireshark.org/review/13865
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-13 23:51:53 +00:00
João Valverde ef929dc8eb Revert "Add free_address_wmem() and other extensions to address API"
This reverts commit 13ec77a9fc.

This commit introduces a segmentation fault for Lua code (uncovered by the test suite).

Change-Id: Ibc273d1915cda9632697b9f138f0ae104d3fb65e
Reviewed-on: https://code.wireshark.org/review/13813
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-08 00:44:22 +00:00
João Valverde 13ec77a9fc Add free_address_wmem() and other extensions to address API
Try to improve 'address' API (to be easier/safer) and also avoid
some constness warnings by not overloading the 'data' pointer to
store malloc'ed buffers (use private pointer for that instead).

Change-Id: I7456516b12c67620ceadac447907c12f5905bd49
Reviewed-on: https://code.wireshark.org/review/13463
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-07 23:22:30 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Martin Kaiser 0c7eb4a4f4 [dcom] don't THROW() an exception from a dissector
try to clean up the use of signed vs unsigned data types
in dissect_dcom_BSTR without affecting any other function:

offsets are gint
if we have to add a guint32 to an offset, do a range check before adding
if we see an overflow, return the number of bytes consumed up to that point

Change-Id: Ib06c19fee8e3477e07b190ca26743891a5b24c3d
Reviewed-on: https://code.wireshark.org/review/13082
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-07 11:46:17 +00:00
Balint Reczey 9a9b1c9bba Spelling fixes for errors found by lintian
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20
Reviewed-on: https://code.wireshark.org/review/11945
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-07 07:11:54 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
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>
2015-10-22 11:45:56 +00:00
Pascal Quantin d34267d050 DCOM: ensure to initialize IPv4 variable put on the stack
Bug: 11610
Change-Id: I920b88ab035ff34e7cff9eab8158aa2dabe2faac
Reviewed-on: https://code.wireshark.org/review/11134
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-10-18 21:17:53 +00:00
Peter Wu ea46cf4f73 Split init of misc dissectors into init/cleanup functions
Convert remaining dissectors to use cleanup routines when possible.
(Single-)linked lists require NULL, so do reset their pointers to NULL.

Generated with
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=69af86e6c2cf965ba3d7f9636b647b195f0b7d57
(with AUDIT = ALWAYS_EMIT_CLEANUP_CODE = True)

Remaining dissectors which did not need further changes:
epan/dissectors/packet-aeron.c
epan/dissectors/packet-bootp.c
epan/dissectors/packet-brdwlk.c
epan/dissectors/packet-drda.c
epan/dissectors/packet-etch.c
epan/dissectors/packet-fix.c
epan/dissectors/packet-fw1.c
epan/dissectors/packet-lbm.c
epan/dissectors/packet-ldss.c
epan/dissectors/packet-simulcrypt.c
epan/dissectors/packet-spdy.c
epan/dissectors/packet-starteam.c
epan/dissectors/packet-udp.c

Change-Id: Idcacfea6a5de38d40e67db4cdcd0452ad9f9a6a9
Reviewed-on: https://code.wireshark.org/review/9228
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:37:18 +00:00
Micha Reiser afe07a9b09 - Mark some DCE/RPC functions as public do allow calls from plugins
- DCOM:
 	* Mark some DCOM functions as public do allow calls from plugins
	* Add Support for Additional Variant Types  Money, I8, UI8
	* Fix an uint32 overflow when dissecting nwstringz0 where the length is 0
	* Use WS_DLL_PUBLIC instead of WS_DLL_PUBLIC_DEF

Change-Id: I02861a09203c6b42326f5a7b7e652e0f7c26d369
Reviewed-on: https://code.wireshark.org/review/8222
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-29 12:52:10 +00:00
Michael Mann aeb9827e4a Convert proto_tree_add_boolean to proto_tree_add_bitmask_[value|value_with_flags|list]
Part 1 of a few

Change-Id: I413f23dfa92da5488ca8a7f62ca0738b25004635
Reviewed-on: https://code.wireshark.org/review/8117
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-18 16:32:27 +00:00
Guy Harris 499d95964d Eliminate e_uuid_t in favor of e_guid_t.
That eliminates a redundant and confusing data type, and avoids issues
with one piece of code using e_uuid_t but wanting to use routines
expecting an e_guid_t.

Change-Id: I95e172d46d342ab40f6254300ecbd2a0530cde60
Reviewed-on: https://code.wireshark.org/review/7506
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-03 10:55:29 +00:00
Bill Meier 0cd2582e8d Prevent two false positive MSVC2013 Code Analysis warnings
Message: "Using uninitialized memory"

Change-Id: Ib7d381beb9f9c1f3ec19a376c0c8c0d5ef85f373
Reviewed-on: https://code.wireshark.org/review/7069
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-11 17:10:12 +00:00
Michael Mann e530c89940 Replace se alloced memory in compare stat tap.
Also replaced comments mentioning se_alloc memory with wmem_file_scope, since it's more accurate.

It seems that many of the TShark stat taps may be leaking memory, because the hash tables created by the taps don't get a chance to be freed.  Somewhat academic since TShark exits shortly after displaying any stats, but a leak none the less.

Change-Id: I8ceecbd00d65b3442dc02d720b39c2e15aa0c8a6
Reviewed-on: https://code.wireshark.org/review/6557
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16 00:37:02 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00
Bill Meier b68fb9b659 Fix some dissectors doing termio (fprintf(stderr,..), g_warning()).
- Use report_...failure() (in most cases).
- Also: Do some misc fixes in certain disectors
  - re-arrange order of #includes
  - Fixup preferences help text

Change-Id: I385f6f97257f365f53ce611df02f57f9257dc5f9
Reviewed-on: https://code.wireshark.org/review/6039
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 20:55:25 +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 0b9eb9f4b7 Get rid of unnecessary includes of ctype.h.
Change-Id: I2cf49f808558147ce77e7d086558966cfb2defca
Reviewed-on: https://code.wireshark.org/review/4850
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-20 06:02:51 +00:00
Bill Meier 482e8e5651 Add editor modelines & adjust indentation/whitespace as needed.
Change-Id: Ice2d93632cd42dfcef3bfbf0e15f2a8a147278fc
Reviewed-on: https://code.wireshark.org/review/4433
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-02 22:30:52 +00:00
Guy Harris 5bfc21cf9e Clean up handling of missing functions.
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.

If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.

Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.

Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.

Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 21:03:09 +00:00
Guy Harris d3df2e588b On UN*X, <arpa/inet.h> suffices for struct in_addr and in_addr_t.
So don't pull in <netinet/in.h>.  Also, avoid <sys/types.h> in
packet-dcom.c.

While we're at it, do *not* assume that pinfo->src or pinfo->dst are
IPv4 addresses.

Change-Id: I5fc8e859780a8d863aaf6e90a21a7039cabae0e6
Reviewed-on: https://code.wireshark.org/review/1006
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-08 08:23:34 +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 746ee39329 Drop isprint.h use g_ascii_isprint() when this include hack was enabled.
svn path=/trunk/; revision=54327
2013-12-21 15:01:45 +00:00
Anders Broman e8b935ad6e Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54209
2013-12-18 06:51:09 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 22760b2d2a Remove pinfo->private_data from DCERPC dissectors and instead have dcerpc_info* infomation be passed in as a function parameter. Bug 9387 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9387)
All "generated" source was manually modified (with the power of search/replace), but I believe the "source input" files have been adjusted (checked into revs 53098 and 53099) to reflect the necessary changes (with possible whitespace formatting differences).

The Microsoft compiler doesn't flag "unused function parameters", so I apologize in advance if I may have missed a few.  The "dcerpc_info* di" parameter is used in almost every function.

svn path=/trunk/; revision=53100
2013-11-06 14:31:29 +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
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +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
Michael Mann 2d37ec3cb0 Batch of filterable expert infos.
svn path=/trunk/; revision=49853
2013-06-09 03:28:05 +00:00
Anders Broman 263a9d0683 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48341
2013-03-16 16:25:41 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Bill Meier 1823aa007c it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47891
2013-02-26 01:06:19 +00:00
Bill Meier c439b805e2 Comment out unused hf[] entries & etc.
(found by checkhf)

svn path=/trunk/; revision=47389
2013-01-31 17:55:31 +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
Evan Huus ae3ff16465 Fix C++-style comment caught by checkAPI.
svn path=/trunk/; revision=44725
2012-09-01 13:02:14 +00:00