Commit Graph

40 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
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
Guy Harris f6791c1ab9 Stylistic and whitespace cleanups.
Change-Id: Ib3a0ca9793925a626ea3121ed2581f23d103bb2c
Reviewed-on: https://code.wireshark.org/review/13196
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-12 00:03:58 +00:00
AndersBroman 0028867c53 Try to fix "Werror=misleading-indentation"
Change-Id: I9702a8afad787191b0c5bd8630ef2ec011cceb17
Reviewed-on: https://code.wireshark.org/review/13183
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-11 19:23:47 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Michael Mann bbdd89b973 create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: Ie514f126352e7598acc4f7c38db9c61d105d5e48
Reviewed-on: https://code.wireshark.org/review/11850
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-16 03:50:05 +00:00
Michael Mann 90a76e0d51 Convert val_to_str -> val_to_str_wmem.
This is mostly for GUI usage, but a few dissectors needed some "non-packet scope" conversions.

val_to_str officially now uses wmem_packet_scope()

Change-Id: Ic9413eeb3406d7a7683222b86709f3675d628d81
Reviewed-on: https://code.wireshark.org/review/6933
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-04 06:58:49 +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
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
Bill Meier 3c0a6681e8 Add editor modelines and adjust indentation as needed.
Change-Id: I857700d685354b0bc9e0ca647c57faba981b520f
Reviewed-on: https://code.wireshark.org/review/4373
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-29 18:50:46 +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
Pascal Quantin 7623232f25 Convert a few more dissectors to wmem
svn path=/trunk/; revision=52013
2013-09-13 17:25:54 +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 54eb4a6cec [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48319
2013-03-15 16:39:30 +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
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
Michael Mann 1d9c472cae convert some simple uses to use ephemeral memory
svn path=/trunk/; revision=44413
2012-08-10 02:05:19 +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 1ec161eab8 Minor cleanup: whitespace, indentation, long-lines, style, typos, etc;
Also: remove unneeded #include <stdlib.h> in 2 cases.

svn path=/trunk/; revision=42226
2012-04-24 18:27:06 +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
Anders Broman fc447d3377 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39147
2011-09-26 09:01:17 +00:00
Bill Meier 2bf572bc41 Remove unneeded #includes: proto.h,tvbuff.h,value_string.h,stdlib.h,...
svn path=/trunk/; revision=38413
2011-08-08 17:59:32 +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 54ed1b0bc7 Define a few global variables as static.
svn path=/trunk/; revision=34411
2010-10-07 21:16:52 +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
Bill Meier 7172127412 #include reassemble.h not req'd
svn path=/trunk/; revision=27911
2009-03-31 12:08:44 +00:00
Bill Meier 808a4e2c3c Define certain fcns as static (if not used externally).
Also: whiule we're at it: 
 - fix hf[] blurbs as appropriate to use NULL;
 - fix some indentation

svn path=/trunk/; revision=27890
2009-03-29 22:16:26 +00:00
Bill Meier 09d097e7a7 #include <conversation.h> not req'd ....
svn path=/trunk/; revision=27389
2009-02-06 20:33:53 +00:00
Bill Meier 77b81b391b #include <prefs.h> not req'd
svn path=/trunk/; revision=26089
2008-08-25 22:06:20 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Jörg Mayer f9a57f08d1 Bill Meier:
Spelling fixes.

svn path=/trunk/; revision=16956
2006-01-05 13:01:08 +00:00
Jörg Mayer 402c4dd9a7 Don't reinvent the wheel, use val_to_str/match_strval
svn path=/trunk/; revision=16130
2005-10-05 15:44:04 +00:00
Gerald Combs 078df6ca6c Fix another infinite loop found by randpkt.
svn path=/trunk/; revision=15339
2005-08-13 18:49:57 +00:00
Gerald Combs 4e4aa78bcc Remove proprietary information at the author's request.
svn path=/trunk/; revision=15282
2005-08-10 19:31:21 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Gerald Combs 65fdf41f63 Fix an infinite loop found by randpkt testing. Change the line endings from
DOS to UNIX.

svn path=/trunk/; revision=14635
2005-06-15 17:56:47 +00:00
Anders Broman 5757748947 From Angelo Bannack,
A CSM_ENCAPS dissector to use with ethereal. 
The CSM_ENCAPS is a protocol used by MindSpeed to communicate with your products, and configure VoIP channels.

svn path=/trunk/; revision=14612
2005-06-11 15:58:01 +00:00