Commit Graph

63 Commits

Author SHA1 Message Date
Martin Mathieson 82827278f7 More dissector string spelling fixes.
Finally, it is becoming difficult to find more.
2020-09-13 09:03:08 +01: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
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
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
Michael Mann b7f4e25059 Adjust proto_tree_add_uint_format_value calls to use unit string
Several calls to proto_tree_add_uint_format_value could be better served
using BASE_UNIT_STRING with a "unit string" in hf_ field.  There also
a few cases where proto_tree_add_uint_format_value could just be
proto_tree_add_uint.

Added a few more "common" unit string values to unit_strings.[ch]

Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d
Reviewed-on: https://code.wireshark.org/review/19242
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13 22:56:50 +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
Michael Mann 01f7356f85 register_dissector -> new_register_dissector
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: I3d5e576b796556ef070bb36d8b55da0b175dcba8
Reviewed-on: https://code.wireshark.org/review/11805
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-11-13 17:44:24 +00:00
Michael Mann 7298a31687 Eliminate proto_tree_add_text from ANSI dissectors.
Change-Id: I22dccb2f2d71897334e11632f4060ccfbf4794ad
Reviewed-on: https://code.wireshark.org/review/10334
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>
2015-09-01 04:10:06 +00:00
Michael Mann d729d8055b Convert "macro checks" to use expert info in line with dissectors with comparable checks.
Change-Id: I30affba4941ba150c34541bfba67ff8da5b52a17
Reviewed-on: https://code.wireshark.org/review/9015
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-22 05:35:50 +00:00
AndersBroman 870d223b69 Change deprecated API tvb_length -> tvb_reported_length
Change-Id: I14577dccaed5aa5ed85e94b6810a94b4c8b2e437
Reviewed-on: https://code.wireshark.org/review/8059
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-14 06:58:40 +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
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
Bill Meier f412c9a01a Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...
(for some dissectors which fetch all other integral fields using
   ENC_BIG_ENDIAN).

Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56
Reviewed-on: https://code.wireshark.org/review/5748
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 18:45:56 +00:00
Bill Meier 70abd39bb7 Reformat hf[] entries; Add editor modelines & adjust whitespace.
Change-Id: I30b25db89d3fbae5f3913ede8bf7bd66fd2516da
Reviewed-on: https://code.wireshark.org/review/4432
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-02 22:30:27 +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
Michael Mann 3bdc0f9f2d packet-ansi_801.c: proto_tree_add_text -> somthing filterable
Change-Id: I780c270f58ad0e8f8fabd121ad0cb5fdcfd593a2
Reviewed-on: https://code.wireshark.org/review/1933
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-04 04:23:49 +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
Bill Meier 6544ea2078 Let's see if this fixes VS Code Analysis warnings:
C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. \
                              Results might not be an expected value

svn path=/trunk/; revision=54011
2013-12-13 02:36:27 +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 a3a15ff90b Remove instances of unused 'data_handle' (and of one other handle).
svn path=/trunk/; revision=52767
2013-10-22 16:13: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
Jakub Zawadzki f4bcbeb9f2 Keep result of [new_]register_dissector in some dissectors. [2 of x]
(don't create new dissector handle if we can use already existing one)

svn path=/trunk/; revision=51159
2013-08-05 19:09:44 +00:00
Michael Mann c83619a25a Remove unnecessary global variables
svn path=/trunk/; revision=49141
2013-05-03 00:39:14 +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 221b249acd svn path=/trunk/; revision=48272 2013-03-12 21:58:04 +00:00
Guy Harris 808c79a6b4 Everything else in the floating-point calculations is single-precision,
so make the constants single-precision, so we don't end up with warnings
about double-precision values being assigned to single-precision
variables.

svn path=/trunk/; revision=46658
2012-12-21 08:18:47 +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 b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Bill Meier d12d5a606c AFAICT sys/types.h & netinet/in.h #includes are not needed for these files.
(Let's see if any of the buildbots give any errors).
Also: remove trailing whitespace on lines.

svn path=/trunk/; revision=42429
2012-05-04 21:29:00 +00:00
Bill Meier 4f8e416fdc Fix benign issue: For FT_BOOLEAN fields with a zero bitmask, use BASE_NONE for 'display'
svn path=/trunk/; revision=41385
2012-03-06 22:12:42 +00:00
Bill Meier 1f807cc26a Indentation & whitespace cleanup....
svn path=/trunk/; revision=41093
2012-02-20 23:28:23 +00:00
Bill Meier 54b72021bb Fix encoding arg for various fcn calls:
- proto_tree_add_bits_item
 - proto_tree_add_bits_ret_val
 - proto_tree_add_bitmask
 - tvb_get_bits
 - tvb_get_bits16
 - tvb_get_bits24
 - tvb_get_bits32
 - tvb_get_bits64


svn path=/trunk/; revision=39539
2011-10-24 19:57:53 +00:00
Bill Meier b708c2892b Dissectors don't need to #include <gmodule.h>
Also: #include <stdlib.h> not req'd in some cases.

svn path=/trunk/; revision=38409
2011-08-08 15:41:09 +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
Bill Meier 69df32fb11 #include <string.h> not needed.
svn path=/trunk/; revision=32411
2010-04-06 22:09:47 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Gerasimos Dimitriadis 85fb36759b Update IS-801 Request Pseudorange Measurement; Rename
'spare bits' to 'reserved bits'

svn path=/trunk/; revision=31707
2010-01-27 22:36:29 +00:00
Gerasimos Dimitriadis c08fa6f3cf Move underscore escaping/unscaping function to strutil.c;
Update decoding of IS-801 Request GPS Acquisition Assistance

svn path=/trunk/; revision=31685
2010-01-26 18:21:17 +00:00
Gerasimos Dimitriadis 372ff060cc Rewrite IS-801 decoding of Provide GPS Satellite Health
Information; function ansi_801_tvb_get_bits no longer
needed

svn path=/trunk/; revision=31639
2010-01-23 23:11:49 +00:00
Gerasimos Dimitriadis 24f4322584 Whitespace edits; registration of the ansi_801 dissector
svn path=/trunk/; revision=31638
2010-01-23 21:42:01 +00:00
Gerasimos Dimitriadis effc28a97c Insert casts to float to make the buildbot happy
svn path=/trunk/; revision=31637
2010-01-23 21:34:27 +00:00
Gerasimos Dimitriadis 10ee7a707d Update IS-801 decoding Provide Location Response;
bit structure is shown and values are interpreted.

svn path=/trunk/; revision=31636
2010-01-23 20:30:54 +00:00
Anders Broman 440c3f9261 From Didier Gautheron:
check_col.diff
Remove redundant calls to check_col() if it guards only one columns function with one parameter after the column type.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394

svn path=/trunk/; revision=31519
2010-01-13 20:32:01 +00:00
Kovarththanan Rajaratnam 17c9803cac Sanitize epan includes
svn path=/trunk/; revision=29499
2009-08-21 20:25:24 +00:00
Bill Meier 90e865cc54 Init ett_... variables to -1
svn path=/trunk/; revision=29294
2009-08-04 18:48:45 +00:00
Bill Meier 548e468959 Misc dissector cleanup:
- Make some fcns & vars static
- hf[] blurbs: "" and repeated text --> NULL
- Move proto_register & proto_reg_handoff to end of source
- packet-catapult-dct2000: simplify proto_reg_handoff
- Use consistent indentation

svn path=/trunk/; revision=28488
2009-05-26 16:01:12 +00:00
Bill Meier c544c20956 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27050
2008-12-18 19:08:49 +00:00