Commit Graph

50 Commits

Author SHA1 Message Date
Evan Huus 8ee8808876 First pass pinfo->pool conversion, part 2
Automated find/replace of wmem_packet_scope() with pinfo->pool in all
files where it didn't cause a build failure.
2021-07-21 09:54:57 -04:00
Guy Harris 75c739e4b7 ISDN, LAPD: clean up the way they connect to other dissectors.
Have the ISDN dissector take the ISDN pseudo-header through its data
argument, rather than assuming it's in pinfo->pseudo_header, so it can
be used if the link-layer type of the capture isn't ISDN.

Have it add the direction to its protocol tree, so it's there for all
ISDN packets.

Have more versions of the LAPD dissector:

	one where the ISDN direction information is available through
	an ISDN pseudo-header passed as its data argument;

	one for use when the link-layer type *is* LAPD, where the ISDN
	direction information may be available through the direction
	part of the packet flags.

Pass more flags to the routine that does LAPD dissection to indicate the
direction (user->network or network->user) and whether the user or
network side is on another machine; set those appropriately in the
dissector routines that call it.  To set those flags:

	in the routine that handles WTAP_ENCAP_LAPD, check the direction
	flags in pinfo->rec->rec_header.packet_header.pack_flags;

	in the routine that handles WTAP_ENCAP_LINUX_LAPD, check the SLL
	header;

	in the routine that's called from the ISDN dissector and other
	dissectors that can supply an ISDN pseudo-header, check the
	struct isdn_phdr passed to it via the data argument;

	for the routine that's to be called from L2TP pseudowire type
	and SCTP dissector tables, pass nothing, as there's currently
	no direction indication supplied - if that information is
	available from the encapsulating protocol in some fashion, we
	should make changes to supply that information.

Have the AudioCodes Trunk trace protocol dissector call the
LAPD-with-pseudoheader dissector, handing it an ISDN pseudo-header with
a direction indication from the direction field (and a channel of 0 to
indicate the D channel).

Have the Ascend text dump reader in libwiretap use WTAP_ENCAP_ASCEND for
all packets, even Ethernet and ISDN packets, and have the Ascend text
dump dissector handle that, calling the "no FCS" version of the Ethernet
dissector and calling the LAPD-with-pseudoheader dissector with a
pseudo-header filled in with the direction (and a channel of 0).

Have the Catapult DCT 2000 text dump dissector call the
LAPD-with-pseudoheader dissector with the pseudo-header supplied by
libwireshark.

Have the V5 envelope function frame get its ISDN pseudo-header from its
data argument, and call the LAPD-with-pseudoheader dissector with that
pseudo-header.

Have the ISDN dissector treat its data argument as pointing to the ISDN
pseudo-header, rather than assuming it's the one in
pinfo->pseudo_header->isdn - the latter is the one supplied by
libwiretap, but there's no guarantee that an ISDN pseudo-header was
supplied by libwiretap, as the lowest-level protocol layer might not
have been ISDN.

Change-Id: I9f702b879bbc3fb42bcb43c28f797bfc327562c6
Reviewed-on: https://code.wireshark.org/review/37953
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-25 18:31:34 +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
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 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +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
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 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
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 3fa5625ea0 Eliminate proto_tree_add_text from some dissectors.
Change-Id: Ib6024307e85d6c23decf40e9759f549c19ffe136
Reviewed-on: https://code.wireshark.org/review/3318
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-03 16:29: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
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +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
Evan Huus 1b13606b6f Now that the test suite is done and most of the common functions are
implemented, start replacing emem with wmem in dissectors.

Also remove emem.h include from a few files that didn't actually need it.

More to come once in hopefully large batches once I figure out the
appropriate regexes.

svn path=/trunk/; revision=49009
2013-04-24 00:01:45 +00:00
Anders Broman 455f5c8243 - [-Wmissing-prototypes]
- explicit casts.

svn path=/trunk/; revision=48265
2013-03-12 20:00:50 +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
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
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
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +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
Alexis La Goutte 65edc0dc95 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41301
2012-03-02 11:03:46 +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
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 9675740701 Use value_string_ext fcns to access certain value_string arrays;
Sort several value_string arrays to be in ascending order.
Also: Minor whitespace cleanup.

svn path=/trunk/; revision=34766
2010-11-03 22:08:49 +00:00
Bill Meier 10ffd14b8f Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)
svn path=/trunk/; revision=32735
2010-05-10 15:54:57 +00:00
Anders Broman aaa917be72 remove check_col
svn path=/trunk/; revision=32089
2010-03-03 13:52:17 +00:00
Stig Bjørlykke b3a5cf28a5 Removed unused variables.
svn path=/trunk/; revision=30896
2009-11-09 14:40:35 +00:00
Bill Meier 8ccb52de00 Upon 2nd thought: revert removal of 'if (check_col(...))' around col_add_fstr & etc.
svn path=/trunk/; revision=30133
2009-09-25 00:29:06 +00:00
Bill Meier 8b2d2d9488 Minor changes:
- remove unneeded includes;
 - check_col no longer req'd;
 - move proto_register/proto_reg_handoff to the end of the file;
 - fix some typos;

svn path=/trunk/; revision=30116
2009-09-24 16:22:37 +00:00
Kovarththanan Rajaratnam 0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +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
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +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 802f4452b4 Minor cleanup related to proto_reg_handoff ....
svn path=/trunk/; revision=26176
2008-09-11 14:07:02 +00:00
Bill Meier 8d9c5d9b2b Cleanup related to prefs & proto_reg_handoff
svn path=/trunk/; revision=26124
2008-09-02 21:40:46 +00:00
Stig Bjørlykke 1689ec6a8d Make the ACTRACE dissector give away the package if it knows its not a ACTRACE.
svn path=/trunk/; revision=25526
2008-06-22 18:42:37 +00:00
Anders Broman 840a048b7f Implement some of the minor possible speed improvment patches.
svn path=/trunk/; revision=23192
2007-10-15 20:11:25 +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
Guy Harris 2f6530246c Give them RCS IDs.
svn path=/trunk/; revision=15911
2005-09-20 22:52:31 +00:00
Luis Ontanon 273dc953ea change g_strdup() calls with ep_strdup calls (fixing a significant leakage of tap data)
svn path=/trunk/; revision=15029
2005-07-24 02:56:41 +00:00
Guy Harris f64a0aa20b Get rid of most unused arguments and variables (including some that are
set but not used).  (Leave "pi" around so the warning acts as a reminder
that the tap structure stuff needs a cleanup - currently, the tap
structures aren't freed; perhaps the new memory allocation scheme
proposed by Ronnie could be used for tap structures.)

Have "ac_istrace()" return NOT_ACTRACE for apparently non-actrace
packets and return the packet type for actrace packets, so that we don't
need a global variable for the packet type.

Make "actrace_udp_port" unsigned to squelch a signed vs. unsigned
warning.

Use "col_set_str()" rather than "col_add_str()" when setting the
Protocol column.

We don't recognized packets as CAS packets unless they're 48 bytes long,
so we don't need to test whether they're 48 bytes long in the CAS packet
dissection code.

Use the reported length, not the captured length, when doing length
checks.

svn path=/trunk/; revision=14874
2005-07-08 02:31:45 +00:00
Guy Harris 6e1081bf45 Squelch a compiler warning.
svn path=/trunk/; revision=14813
2005-06-28 22:39:56 +00:00
Gerald Combs 7f2a239179 Add missing commas.
svn path=/trunk/; revision=14804
2005-06-28 14:46:47 +00:00
Gerald Combs 4c6c39effd Terminate a bunch of value_strings.
svn path=/trunk/; revision=14803
2005-06-28 14:02:21 +00:00
Ronnie Sahlberg 6838ce2807 remove a \n in the preference string to prevent it from creating a garbage/invalid preference file entry.
svn path=/trunk/; revision=14798
2005-06-27 11:06:40 +00:00
Anders Broman e37467eb29 From Alejandro Vaquero
new dissector for the AudioCodes trunk trace protocol. 
This protocol is used to debug the trunk protocol in AudioCodes 
gateways. It currently supports ISDN PRI and CAS (MFCR2, WinkStart, 
etc...) trunk protocols. It also add these protocols in the "Voip Calls 
Graph..."

svn path=/trunk/; revision=14790
2005-06-27 06:21:51 +00:00