Commit Graph

113 Commits

Author SHA1 Message Date
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
Martin Mathieson 88923604b2 Fix up some broken links to specs from dissectors.
check_dissector_urls.py was written and used to
find URLs within epan/dissectors/*.c and try to
fetch them using 'requests'. Will be commmitted
separately.

Most of the changes were to adapt to reorganisation
of IETF or 3gpp2 links, but many of the broken links
are for websites or companies that no longer exist.

Change-Id: Ie9afdb95099218402a61626a0cd5193c6f781b96
Reviewed-on: https://code.wireshark.org/review/36769
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-04-12 15:03:14 +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
João Valverde 7466880e8a Parse enterprise-numbers at run time
"enterprise-numbers" is converted to tab-separated values and renamed
"enterprises". Unused fields are stripped.

PENs are stored in a hash table loaded at run-time.

User "enterprises" file is loaded from the personal config dir.

Misc make-sminmpec.pl improvements and fixes.
Note: names of type "Entity (formerly ...)" have the formerly part commented out for a cleaner output.

Change-Id: I60c533afbe3e399077fbf432088064471ad3e1e2
Reviewed-on: https://code.wireshark.org/review/22246
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2017-06-26 22:40:50 +00:00
Michael Mann f4b0abc729 Dissectors don't need a journey of self discovery.
They already know who they are when they register themselves.  Saving the
handle then to avoid finding it later.
Not sure if this will increase unnecessary register_dissector functions
(instead of using create_dissector_handle in proto_reg_handoff function)
when other dissectors copy/paste, but it should make startup time
a few microseconds better.

Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43
Reviewed-on: https://code.wireshark.org/review/19481
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>
2016-12-31 07:31:42 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 02:51:18 +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
Bill Meier 9c866ff971 Replace tabs by spaces when editor modelines has "expandtab"
Change-Id: If7a6f2697be732ae4f94ed8b845fd293c32510f7
Also: tabs-stops should be 8
Reviewed-on: https://code.wireshark.org/review/7100
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-13 17:34:53 +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
Michael Mann 05516b0c92 Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.
Part 1 of many

Change-Id: I77a5789ac23388e6a5f8098dc398592f39638124
Reviewed-on: https://code.wireshark.org/review/5532
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-29 22:42:56 +00:00
Michael Mann a9e6c2c917 Overhaul the filterability of packet-ansi_683.c
It's (ab)use of proto_tree_add_text was "hidden" behind a single FT_NONE hf item, that effectively had the same behavior of proto_tree_add_text, but wouldn't show up in checkAPIs.pl.  Replaced the (over 200+) proto_tree_add_none_format calls with proto_tree_add_text and then ran convert_proto_tree_add_text.pl on the dissector.  That started the cleanup, and I did more while in the neighborhood.

Change-Id: I89e09cf23e8998bcc9197f9a4043e1fc2850fc8c
Reviewed-on: https://code.wireshark.org/review/4521
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-07 21:14:28 +00:00
Michael Mann 29993d5266 Eliminate proto_tree_add_text from some dissectors.
Change-Id: Ie41ac30f8edaeee75b23717ef1d5147d804a65b3
Reviewed-on: https://code.wireshark.org/review/4074
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-09-11 06:33:23 +00:00
Bill Meier cc286bad25 Various minor changes:
- Create/use some extended value_strings
- Remove unneeded #includes;
- Do whitespace changes;
- Add editor modelines.

Change-Id: I2e1ea37dddfd5e8656c90c0d45a6596c4912bb2c
Reviewed-on: https://code.wireshark.org/review/4065
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-10 16:17:29 +00:00
Bill Meier 93cc6f004f Fix some spelling & grammar.
Change-Id: Iedeaa411caa0823922dd79c27897a2349d4e6907
Reviewed-on: https://code.wireshark.org/review/4054
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-09 19:43:27 +00:00
Evan Huus c1bc1b6a83 Convert some deprecated tvb_length calls
Change-Id: I6337f8e02a41106a363b9bf767bc4b3697442d41
Reviewed-on: https://code.wireshark.org/review/4027
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-09-08 14:11:44 +00:00
Michael Mann f5e2b4293d convert to proto_tree_add_subtree[_format]
Change-Id: I358bfaa4e5d40cd01b766f614f8bd0dbaf611dd0
Reviewed-on: https://code.wireshark.org/review/2508
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 14:34:17 +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
AndersBroman 1d1730fc56 Update some soft-deprecated APIs.
Change-Id: I0e255e72dd4cd9a94a4f92af409c4b34c0a266ed
Reviewed-on: https://code.wireshark.org/review/1491
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-04 19:23:05 +00:00
Michael Mann b40cb1adea Apply found fix-encoding-args.pl errors in the dissector directory.
I coincidentally found a few files with errors, so I thought it might be time to run it on the whole directory again.

Change-Id: Ia32e54b3b1b94e5a418ed758ea79807c8bc7e798
Reviewed-on: https://code.wireshark.org/review/978
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06 15:11:36 +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 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 76d4b43a29 Minor whitespace, formatting & etc changes.
svn path=/trunk/; revision=52588
2013-10-13 18:14:59 +00:00
Michael Mann eda89e591f Improve "eHRPD Indicator" NVSE dissection in 3GPP2 A11 Registration Request. Bug 9206 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9206)
From Masayuki Takemura

svn path=/trunk/; revision=52403
2013-10-06 15:38:32 +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
Michael Mann 7e8e5b347e Batch of filterable expert_infos.
svn path=/trunk/; revision=49581
2013-05-25 17:06:40 +00:00
Martin Kaiser 31435deea7 Coverity CID 281193: Dead code
svn path=/trunk/; revision=48801
2013-04-09 21:02:03 +00:00
Guy Harris 98938830d5 Fix some bugs that showed up as format warnings.
Use "offset +" in the calls to fill in the Info column, as presumably
the values being put into that column are the same as the values being
put into the protocol tree, and those have offsets based on the offset
variable.

svn path=/trunk/; revision=48755
2013-04-05 23:46:20 +00:00
Anders Broman 63d3ef878f Add dissection from BCMCS spec.
svn path=/trunk/; revision=48754
2013-04-05 22:16:02 +00:00
Jeff Morriss 4508745e3b Get rid of non-ASCII characters.
svn path=/trunk/; revision=48722
2013-04-03 17:46:39 +00:00
Anders Broman c534f5e0db - Extend and correct value strings.
- Fix tree handling for QoS.
- Add references.

svn path=/trunk/; revision=48718
2013-04-03 16:49:55 +00:00
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Anders Broman 04766017df - [-Wmissing-prototypes]
- explicit casts.

svn path=/trunk/; revision=48282
2013-03-13 21:14:20 +00:00
Anders Broman 455f5c8243 - [-Wmissing-prototypes]
- explicit casts.

svn path=/trunk/; revision=48265
2013-03-12 20:00:50 +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
Pascal Quantin 062ad6bad1 pinfo is now used
svn path=/trunk/; revision=45338
2012-10-06 10:03:41 +00:00
Pascal Quantin 75dd452b24 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7801 :
Ensure that the sub-type length is at least 2 (for sub-type and length fields).
Prevents an infinite loop when the length equals 0.

svn path=/trunk/; revision=45337
2012-10-06 10:01:59 +00:00
Michael Mann b89a06a3e1 replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45059
2012-09-23 00:12:14 +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
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +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
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Anders Broman b69547925f Get rid of a couple of warnings.
svn path=/trunk/; revision=43066
2012-06-04 13:52:46 +00:00
Anders Broman 9f3c1e5add the blurb for field /"PCF IP Address/" (/"a11.ext.ase.pcfip/") matches the field name in packet-3g-a11.c
svn path=/trunk/; revision=42215
2012-04-23 18:55:19 +00:00
Bill Meier 8819fa284c Replace hf[] "duplicate blurbs" by NULL;
Use consistent indentation (replace 4-space tabs by spaces);
Use consistent formatting style.

svn path=/trunk/; revision=42211
2012-04-23 16:23:57 +00:00
Alexis La Goutte ba4c8fdbc3 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41313
2012-03-02 11:08:49 +00:00
Chris Maynard 043f5f71d0 Fix Coverity CID 1342: UNUSED_VALUE
svn path=/trunk/; revision=40315
2011-12-28 17:02:43 +00:00
Anders Broman 35e767e28a Dissect Service Option Profile.
svn path=/trunk/; revision=40297
2011-12-27 10:15:00 +00:00