Commit Graph

197 Commits

Author SHA1 Message Date
Michael Mann be12a252dd Provide new interface for Export PDU.
Rather than have a bitmask for each desired field, have a dissector
provide a list of structures that represent data that goes into
the PDU.

Change-Id: I125190cbaee489ebffb7d9f5d8bc6f3be2d06353
Reviewed-on: https://code.wireshark.org/review/16122
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-29 18:53:46 +00:00
Michael Mann 2ab4155794 tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_string
Also some other tricks to remove unnecessary tvb_get_string_enc calls.

Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914
Reviewed-on: https://code.wireshark.org/review/16158
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-27 15:20:06 +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 e37275bfde Associate dissector tables and heuristic subdissector lists with a protocol.
This will make it easier to determine protocol dependencies.

Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used)

Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d
Reviewed-on: https://code.wireshark.org/review/14446
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17 00:05:17 +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 95dee44a77 const gpointer -> gconstpointer
'const gpointer' is the same as 'void *const'. Replace with gconstpointer
where straightforward (assuming that was the intent) and use gpointer everywhere
else for clarity (that does not change *API* constness contract; it just means
a variable is not declared immutable inside the called funtion).

Change-Id: Iad2ef13205bfb4ff0056b2bce056353b58942267
Reviewed-on: https://code.wireshark.org/review/13945
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-16 05:10:49 +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
Guy Harris 410f9f8c09 Don't define dvbci_event[] in a header, just declare it.
Define it in a source file, and export it to other users. One instance
suffices (and suppresses "defined but not used" errors from
-Werror=unused-const-variable).

Change-Id: I8b8d624344ec08c777d1869ee2692d535f898f19
Reviewed-on: https://code.wireshark.org/review/13198
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-12 04:03:12 +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 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 74541a9596 Don't allow multiple registrations of a protocol in dissector tables.
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing.

The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not.  It's just ENFORCED for Decode As.

Bug: 3949
Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127
Reviewed-on: https://code.wireshark.org/review/11405
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 12:39:40 +00:00
Martin Kaiser 1c5b3c3783 wsgcrypt.h checks internally if we HAVE_LIBGCRYPT
we can #include <wsutils/wsgcrypt.h> without doing the check ourselves

Change-Id: I248431bdb6cfa1bd85b794ec04ce1e4fcd3a7d2d
Reviewed-on: https://code.wireshark.org/review/11483
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-02 11:42:00 +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
Luke Mewburn fc1b48f46b DVBCI: fix typo in comment
Change-Id: I0f6e57b7f16526e7c1b96fb8bd69c003c89b7f42
Reviewed-on: https://code.wireshark.org/review/10119
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-08-19 00:51:59 +00:00
Peter Wu 126e02cd58 Call reassembly_table_destroy and move g_hash_table_destroy
This patch moves g_hash_table_destroy calls from the init routine to
the cleanup routine. Besides that, the conditional check for the hash
table has been removed, assuming that init is always paired with a
cleanup call.

If reassembly_table_init is found, a reassembly_table_destroy call is
prepended to the cleanup function as well.

Comments have been removed from the init function as well as these did
not seem to have additional value ("destroy hash table" is clear from
the context).

The changes were automatically generated using
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4d11f07180d9c115eb14bd860e9a47d82d3d1dcd
Manually edited files (for assignment auditing): dvbci, ositp, sccp,
tcp.

Other files that needed special attention due to the use of
register_postseq_cleanup_routine:

 - ipx: keep call, do not add another cleanup routine.
 - ncp: remove empty mncp_postseq_cleanup. mncp_hash_lookup is used
   even if a frame is visited before (see dissect_ncp_common), hence
   the hash table cannot be destroyed here. Do it in cleanup instead.
 - ndps: add cleanup routine to kill reassembly table, but do not
   destroy the hash table as it is already done in ndps_postseq_cleanup.

Change-Id: I95a72b3df2978b2c13fefff6bd6821442193d0ed
Reviewed-on: https://code.wireshark.org/review/9223
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:35:14 +00:00
Pascal Quantin cdc7d25004 Add ability to export PDUs for heuristic dissectors also
Change-Id: I1bf1aa9794f9b4f106edffd4986fc0b1014522fa
Reviewed-on: https://code.wireshark.org/review/9099
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-25 00:10:13 +00:00
Martin Kaiser dd26d59fb5 DVB-CI: minor cleanup
tvb_length -> tvb_captured_length
copyright ... - 2015

Change-Id: Id3043725edda2b59c06d17de41c8dfc8ea4ae11c
Reviewed-on: https://code.wireshark.org/review/8768
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-04 22:34:52 +00:00
Martin Kaiser 630be088bf DVB-CI: clean up the expert info definitions
sort them by layer
wrap long lines
make the filter strings consistent

Change-Id: Ibbeb405c6356abe61dd9a0194af1c072d2c1c971
Reviewed-on: https://code.wireshark.org/review/8630
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-25 15:37:52 +00:00
Martin Kaiser 5dd44006b6 DVB-CI: kill the last two proto_tree_add_text() calls
Change-Id: I53f9df7bf193551e786ad4ece368f3de702ce8de
Reviewed-on: https://code.wireshark.org/review/8628
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-25 14:59:19 +00:00
Martin Kaiser 16715e01b6 DVB-CI: remove NULL-checks for proto_item_append_text()'s first argument
Change-Id: I6648c20a003392a7435ca0461d2b004a1d415d51
Reviewed-on: https://code.wireshark.org/review/8626
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-25 14:58:29 +00:00
Martin Kaiser b687f719a3 DVB-CI: change two proto_tree_add_text() calls into expert info
Change-Id: Ic5f87480273e0a097900ace6a7538c34b2a89444
Reviewed-on: https://code.wireshark.org/review/8545
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-20 07:54:44 +00:00
Martin Kaiser 2b68570100 DVB-CI: remove some more proto_tree_add_text() calls
Change-Id: I02349c2e7aa00c1b105ab069a9fe9b66d130bc7d
Reviewed-on: https://code.wireshark.org/review/8543
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-19 21:16:08 +00:00
Martin Kaiser 376ba916d4 DVB-CI: remove proto_tree_add_text() calls from the appmmi resource
Change-Id: I422e8644445d7bb8a8ae43f426183db6b8974839
Reviewed-on: https://code.wireshark.org/review/8530
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-18 21:10:33 +00:00
Martin Kaiser b4f895ced7 DVB-CI: remove proto_tree_add_text() calls from the operator profile resource
rename some variables and remove obsolete comments while we're at it

Change-Id: Ib400c371ea52c3681fbc1d25ef42791e4aeff9e4
Reviewed-on: https://code.wireshark.org/review/8529
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-18 21:10:00 +00:00
Martin Kaiser fcb284db97 DVB-CI: remove proto_tree_add_text() calls from the transport layer
Change-Id: I593527fafa38312d5d4e8f778e9af0d6294bb3f8
Reviewed-on: https://code.wireshark.org/review/8528
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-18 21:09:30 +00:00
Martin Kaiser f33aa0c6d4 DVB-CI: fix a TPDU parsing error
if the response TPDU starts with 0x80 (T_SB), this is not an unknown
tag, it simply indicates that the optional header and body are absent

this bug was introduced in e597acdc48

Change-Id: I076a0c9f0ea124e11edbb7a0bc0e41d1ab6f374a
Reviewed-on: https://code.wireshark.org/review/8527
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-18 21:08:57 +00:00
Martin Kaiser b105ce27eb DVB-CI: remove some more proto_tree_add_text() calls
Change-Id: If2f5ee4629b48fe0ffbe76c49952de8fb14fb64e
Reviewed-on: https://code.wireshark.org/review/8380
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-10 15:52:15 +00:00
Martin Kaiser 9b9b994ea6 DVB-CI: make some more items filterable
wrap long lines, remove a trailing space

Change-Id: Ie9cd268ffbc6d021a3f90f3644dc8665daa8e5ca
Reviewed-on: https://code.wireshark.org/review/8292
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-04 21:04:36 +00:00
Martin Kaiser 5c14aecced DVB-CI: remove some proto_tree_add_text() calls
Change-Id: I727132effdb17138c35b0f3282f2f7b3dddb05b4
Reviewed-on: https://code.wireshark.org/review/8278
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-03 17:07:24 +00:00
Martin Kaiser 4e4de74000 DVB-CI Card Information Structure (CIS): start dissecting the device tuples
Change-Id: I20a098eb1fdcfd34eb03b685d6936a6cf5868c0d
Reviewed-on: https://code.wireshark.org/review/7848
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-03-29 16:02:04 +00:00
Gerald Combs cac102eee3 Change a lot of http:// URLs to https://.
Most of our sites are now HTTPS-only. Update URLs accordingly. Update
other URLs while we're at it. Remove or comment out dead links.

Change-Id: I7c4f323e6585d22760bb90bf28fc0faa6b893a33
Reviewed-on: https://code.wireshark.org/review/7621
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-10 19:30:50 +00:00
Michael Mann 2875cd382f Eliminate the hf member out of the address structure.
Using the new address type registration, dissectors can create their own address types with their own (column) filters attached to them, eliminating the need for an address to keep track of a hf_ field.

Change-Id: I2bbec256a056f403a7ac9880d5d76a0b2a21b221
Ping-Bug: 7728
Reviewed-on: https://code.wireshark.org/review/7037
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-09 03:48:53 +00:00
Michael Mann 2209678149 ep_<protocol>_port_to_display -> <protocol>_port_to_display
Adjust any other ep_ related APIs related to the transition.

Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c
Reviewed-on: https://code.wireshark.org/review/6388
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:32:32 +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 36ce5e1b90 Fix encoding-arg mostly for FT_UINT_STRING; Also: Do misc as needed.
Misc: (as needed)
- Add editor modelines;
- Adjust whitespace.

Change-Id: I0e5d877a2a6273842ad8e771ac0c0acbfcb83200
Reviewed-on: https://code.wireshark.org/review/4173
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-18 15:07:58 +00:00
Bill Meier b14bf98c06 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6
Reviewed-on: https://code.wireshark.org/review/4124
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 13:51:51 +00:00
Martin Kaiser b5f4cb5c33 fix multi-byte entries in Operator Profile capability loops
(this problem showed up in an APDU with two 16bit application ids)

Change-Id: Ie4842181b19db984a693534144fac5e91b217b34
Reviewed-on: https://code.wireshark.org/review/3358
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-08-02 15:50:07 +00:00
Bill Meier 9ed99d5c4e Strip some trailing whitespace; Fix some indentation; Add editor-modelines as needed.
Change-Id: I943153e28f468070d86535abad7be032e1386118
Reviewed-on: https://code.wireshark.org/review/2994
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-11 03:20:54 +00:00
Michael Mann 888f22de16 convert to proto_tree_add_subtree[_format]
Change-Id: I2ea1892b5963cc5578cbdd2b03029ca8424f2267
Reviewed-on: https://code.wireshark.org/review/2640
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-25 16:35:14 +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
Pascal Quantin bcff3c57cc Add the ability to dynamically add a new protocol to export PDU dialog box
Change-Id: I83012cc963d514982e40010e837e11a6fcf1bc3e
Reviewed-on: https://code.wireshark.org/review/2423
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-19 06:48:32 +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
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +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
Martin Kaiser 8515bd7633 avoid proto_tree_add_uint_format() when we just want the default
description

Change-Id: Ice06e257a72f3b4ce1229ff90129628f0e3bbcfb
Reviewed-on: https://code.wireshark.org/review/1873
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-05-30 08:03:07 +00:00
Martin Kaiser 0adac831e0 convert SEK and SIV to their binary form only once when a new key/iv is
set, don't do the same conversion for each apdu

Change-Id: I6b19a0b4e138cd9d333b7ab95d6a8ee3eb516293
Reviewed-on: https://code.wireshark.org/review/1694
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-05-19 09:37:03 +00:00
Martin Kaiser f5165ba0f0 remove some more unnecessary initial values
Change-Id: If2abfee444c7a4a163fef031d92b7757b5d23855
Reviewed-on: https://code.wireshark.org/review/1355
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-25 17:53:53 +00:00