Commit Graph

321 Commits

Author SHA1 Message Date
Jeff Morriss c016dcdbf9 Diameter: free the diameter directory variable.
It's only needed for a few milliseconds--there's no need for it to stick around
until the epan scope ends.

As discussed on I51813815babb4c40722c38459139ab9e3e3ccb42.

Change-Id: I81fef351ef2d700cc5ec5866340605704173fbdb
Reviewed-on: https://code.wireshark.org/review/15861
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-13 13:55:43 +00:00
Pascal Quantin 49a83f56a4 Export packets before dissecting them
This way even malformed packets are properly exported

Change-Id: I923825459eea725d0a103810f3883906b95b3b21
Reviewed-on: https://code.wireshark.org/review/15259
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-03 19:03:06 +00:00
Jeff Morriss 43df65a29c Delay registration of Diameter fields until they're needed.
... Like the RADIUS and wimaxasncp dissectors do.

Change-Id: Ifab019a0040d3938e52918a282a3beba9dfcfc70
Reviewed-on: https://code.wireshark.org/review/14900
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-24 06:47:07 +00:00
Alexis La Goutte 4eac95dc96 diameter: fix 'pinfo/vs' was marked unused but was used [-Werror,-Wused-but-marked-unused]
Change-Id: Ib7f1682a3cdeb8571a410db07261ff68bac03432
Reviewed-on: https://code.wireshark.org/review/14977
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-18 10:47:05 +00:00
Dario Lombardo 4400dcfdd2 diameter: change g_malloc to wmem_alloc.
Change-Id: I51813815babb4c40722c38459139ab9e3e3ccb42
Reviewed-on: https://code.wireshark.org/review/14918
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-15 10:47:43 +00:00
Gerald Combs 90e1232672 Use faster string functions at startup.
Use wmem_strconcat and g_strconcat instead of wmem_strdup_printf and
g_strdup_printf when we register various protocols. This shows a fairly
significant speedup in the Visual Studio profiler.

Change-Id: I98709329513daa66ad3665925dc69149c43df884
Reviewed-on: https://code.wireshark.org/review/14855
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-04-07 22:36:28 +00:00
Gerald Combs 232e7474e6 Use faster wmem_str* functions in a few places.
Use wmem_strdup and wmem_strconcat instead of wmem_strdup_printf.

This shaves a small amount of time off of register_all_protocols on
Windows according to the Visual Studio profiler.

Change-Id: Ib6991e8de5b4fc30e960c513a3028c09dfe6a0a4
Reviewed-on: https://code.wireshark.org/review/14770
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-02 18:30:56 +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
Jeff Morriss f67e7d78d8 Rename a variable for clarity.
It's confusing to have 'pdus_tree' mean both the map of pdu_trees and the pdu
trees themselves.

Change-Id: Ie875798eb140b60a1309ddc0c0bf885b48c0407c
Reviewed-on: https://code.wireshark.org/review/14413
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2016-03-11 03:37:23 +00:00
Dario Lombardo b64d19bba2 diameter: change GArray into wmem_array.
This change fixes a leak in packet-diameter that loads a dictionary
but doesn't free all the data. Found by valgrind.

==30481== 36,656 (960 direct, 35,696 indirect) bytes in 24 blocks are definitely lost in loss record 3,417 of 3,421
==30481==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30481==    by 0xA7FE610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==30481==    by 0xA81422D: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==30481==    by 0xA7CDC44: g_array_sized_new (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==30481==    by 0x6863743: dictionary_load (packet-diameter.c:1980)
==30481==    by 0x6863743: proto_register_diameter (packet-diameter.c:2344)
==30481==    by 0x71C4BA4: register_all_protocols (register.c:323)
==30481==    by 0x65EEFA7: proto_init (proto.c:521)
==30481==    by 0x65CD621: epan_init (epan.c:126)
==30481==    by 0x115330: main (tshark.c:1220)

Change-Id: I3c0d19e1accab415355aa0f50c598f0c83356985
Reviewed-on: https://code.wireshark.org/review/13821
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-25 04:31:44 +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 9141bd9700 Add more fields to packet_info structure and use them.
Add fields for the absolute time stamp (and another field for a presence
flag for the absolute time stamp) and the packet encapsulation for the
packet.

This lets us remove the field for the packet encapsulation in the
frame_data structure; do so.

Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39
Reviewed-on: https://code.wireshark.org/review/13499
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 03:50:58 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
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: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
João Valverde 2aab706c5a Remove -Wwrite-strings compiler flag
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are
not useful, they're impossible to fix in a sane way and therefore are being
handled with casts of static strings to (char *).

This just moves the warning to [-Wcast-qual] and a compiler pragma is
in turn required (and used) to squelch that warning.

Remove the Wwrite-strings warning. Let that responsibility fall on the
programmer (as is done by casting).

Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5
Reviewed-on: https://code.wireshark.org/review/12162
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-12 16:21:19 +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
Pascal Quantin aaa28a9d39 Diameter: check IPv6 prefix length before copying it in e_in6_addr structure
Bug: 11792
Change-Id: I37a07044d40f10e9a1a90025d90753fdb3db2278
Reviewed-on: https://code.wireshark.org/review/12248
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-28 12:12:16 +00:00
Gerald Combs b01cd398f9 Diameter: Expand an error message.
If we encounter the wrong ftype, print its name.

Change-Id: I7405ccdd3e099f533c6a8aaf81b60faf4093741a
Reviewed-on: https://code.wireshark.org/review/11790
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-13 07:33:17 +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
Jeff Morriss 49894f0233 Show the Experimental-Result-Code if we don't know have a subdissector for that
vendor ID.

Otherwise the value is simply not shown to the user.

Adding support for a vendor ID's Experimental Result Codes isn't as easy as
modifying the XML so don't add an expert info about it.

Change-Id: I65f2cb13853cc7141fb242fa03c6e474a6c02cb9
Reviewed-on: https://code.wireshark.org/review/11294
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>
2015-10-27 07:27:40 +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
João Valverde a643d14187 Change proto_tree_add_ipv6() to take a struct e_in6_addr pointer
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too.

Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88
Reviewed-on: https://code.wireshark.org/review/10953
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: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-14 12:18:00 +00:00
Jeff Morriss b4762a0434 Generate Diameter's expert info's even when there's no tree so that they show
up in the Expert Infos dialog.

Push the if(tree) check down into the basic type dissectors since we can't
generate/fill the label (which won't be used anyway) when we're not building
the tree (since the proto_item will be faked/NULL).

Change-Id: Ie4f1f6856cfad0dabc7c58cdee2c16c8fc032c6d
Reviewed-on: https://code.wireshark.org/review/10001
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-21 04:53:04 +00:00
Evan Huus aca5f4ee2d Revert "diameter: convert some GArrays to epan wmem_arrays"
This reverts commit 59017a22be.

As indicated by Michael on the original change, this breaks
diameter rather badly for some reason I haven't been able to
determine. Reverting until I can track down the root cause.

Change-Id: Iedfab546a726395c546a88138cd45b6667913a11
Reviewed-on: https://code.wireshark.org/review/9531
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-07-07 02:07:35 +00:00
Evan Huus 59017a22be diameter: convert some GArrays to epan wmem_arrays
Fixes ~30KB of memory leak on startup and a handful of "reachable" memory as
well.

Change-Id: Ia1c633b65fa282c7bbe9d3772dae58643ef15c0e
Reviewed-on: https://code.wireshark.org/review/9495
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-07-04 19:06:27 +00:00
Evan Huus 6c698f3b8a diameter: fix a memory leak on startup
If we can't read the dictionary containing all our definitions, free necessary
memory before returning.

Change-Id: I814962d920852b9a82acb3bb2e7bc41addd835f7
Reviewed-on: https://code.wireshark.org/review/9131
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-25 16:59:45 +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
Michael Mann 6de6f7f0f8 Further refactor SRT stats.
Create "common" SRT tap data collection intended for all GUIs.   Refactor/merge functionality of existing dissectors that have SRT support (AFP, DCERPC, Diameter, FC, GTP, LDAP, NCP, RPC, SCIS, SMB, and SMB2) for both TShark and GTK.

SMB and DCERPC "tap packet filtering" were different between TShark and GTK, so I went with GTK filter logic.
CAMEL "tap packet filtering" was different between TShark and GTK, so GTK filtering logic was pushed to the dissector and the TShark tap was left alone.

Change-Id: I7d6eaad0673fe628ef337f9165d7ed94f4a5e1cc
Reviewed-on: https://code.wireshark.org/review/8894
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-21 03:35:13 +00:00
Anders 99e43f93f6 [Diamater] Sub dissect Suported-Vendor-Id
Change-Id: I5c0014449ef9886ba74abdf8f609860ef37a7831
Reviewed-on: https://code.wireshark.org/review/8582
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-22 11:08:34 +00:00
Jeff Morriss d1f78230c9 Fix Diameter reassembly when the captured tvb length is less than 5 bytes.
Since Diameter does heuristic checks before calling tcp_dissect_pdus() we
have to "manually" ask for more data if the tvb is too short for our
heuristics.

Bug: 11183
Change-Id: I14c36042306b532b53df80cc3971866b76094084
Reviewed-on: https://code.wireshark.org/review/8405
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-05-12 13:09:41 +00:00
Jeff Morriss 80358079fe Add/clarify some comments about how the Experimental-Result-Code AVP is handled.
Specifically we put Experimental-Result-Codes specified by 3GPP in the XML file
and let other vendors' codes be handled through a dissector table.

Change-Id: I2c3977fb959ad84faa5cb90aeb3d191c8b465ede
Reviewed-on: https://code.wireshark.org/review/8319
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-05-06 20:27:26 +00:00
Jeff Morriss 62908879ab Use VALS_EXT_PTR to satisfy checkAPIs.
Change-Id: Ic7a7cfb97be5c3fbca5944328d04d505b54242ad
Reviewed-on: https://code.wireshark.org/review/8176
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-04-23 13:12:19 +00:00
Jeff Morriss 4461f7271d Add special handling of the (derived) AppId AVP type so that we can maintain
one (and only one) Application ID list.

This means we don't have to list all the Application IDs several times in the
XML file.  Collapse those lists into one (much more complete, now) list while
also fixing URIs for several of the specifications (and making it clear for
others that we don't have access to the specification--by declaring their
URI to be "none").

Add a bunch more entries to the list of application IDs.

Change-Id: Ia5c96b1f6f1fe3a9521b3d70142889e3881fae5e
Reviewed-on: https://code.wireshark.org/review/8147
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-22 05:51:45 +00:00
Jeff Morriss 5fbf88f8a5 Use the new request/response framenum hints.
Change-Id: Ic4a3750a55523a5cf8ea72002055ffea1f081dd1
Reviewed-on: https://code.wireshark.org/review/7565
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-03-09 16:11:08 +00:00
AndersBroman 7fee7df2c0 [Diameter] Use proto_tree_add_bitmask() to add the diameter flags.
Change-Id: I9cb6e46551b0a25a458311a53365469552d5c195
Reviewed-on: https://code.wireshark.org/review/7177
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-16 14:17:04 +00:00
Jeff Morriss 33f1256e00 Fix nameless application in NokiaSolutionsAndNetworks.xml (from
I4cd9bd7f7219e4d9ff1bb8a71fab32439a8a9a35).

(The nameless application was causing known applications to be reported as
unknown.)

Add code to the Diameter dissector to report such problems at startup (similar
code exists for other entities).

Tweak the parser debug slightly.

Change-Id: I6b28cda8660e6eb96648c7b3697d7fd85151ac96
Reviewed-on: https://code.wireshark.org/review/6927
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-03 05:58:57 +00:00
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus()
to make TCP-based dissection easier.

Bug: 9851
Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3
Reviewed-on: https://code.wireshark.org/review/6778
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-27 15:14:12 +00:00
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
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>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Bill Meier b68fb9b659 Fix some dissectors doing termio (fprintf(stderr,..), g_warning()).
- Use report_...failure() (in most cases).
- Also: Do some misc fixes in certain disectors
  - re-arrange order of #includes
  - Fixup preferences help text

Change-Id: I385f6f97257f365f53ce611df02f57f9257dc5f9
Reviewed-on: https://code.wireshark.org/review/6039
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 20:55:25 +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
Guy Harris 80e6f6251e Get rid of calls to ctype.h functions.
They don't handle values outside the range -1 to 127, and their behavior
is locale-dependent.  Use g_ascii_isXXX() and g_ascii_toXXX() instead of
isXXX() and toXXX().

If you're checking for printable ASCII, don't use isascii() and don't
use iscntrl(), use g_ascii_isprint().  If you're checking for graphical
ASCII, i.e. printable ASCII except for a space, use g_ascii_isgraph().

Use ws_xton() to convert a hex digit character to the corresponding
numeric value.

Change-Id: Id3039bc586fbf66d8736c2df248c790c0d7a2330
Reviewed-on: https://code.wireshark.org/review/4851
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-20 06:15:19 +00:00
Bill Meier 24d50bc290 Adjust indentation to match editor modelines; Do other minor whitespace changes.
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353
Reviewed-on: https://code.wireshark.org/review/4502
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 17:12:33 +00:00
AndersBroman 5ff7a2639c Minor performance tweaks:
- Only calculate tvb length once.
- Use tvb_reported_length() instead of tvb_reported_length_remaining() as
  this is a subtvb offset is always 0.

Change-Id: I03bd7a95061488d4576fa93f26e6b31d55f88738
Reviewed-on: https://code.wireshark.org/review/4060
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-09-10 13:16:46 +00:00
Jeff Morriss 2d74838e47 Decode the 3GPP MSISDN AVP using the E.164 routines.
Rename dissect_e164_utf8_number() to dissect_e164_msisdn() and give it an
'encoding' argument.

Change-Id: I49cf5d2b24b44a0e69427ceae331f378024391c5
Reviewed-on: https://code.wireshark.org/review/3796
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-22 19:17:25 +00:00
Jeff Morriss 6edc166c14 Decode User-Name as an IMSI in S13/S13' and S7a/S7d.
Also move the application ID macros into the diameter header file.

Change-Id: Iaca5707c8476d81f50ecdb3aab76be293b5ccfe7
Reviewed-on: https://code.wireshark.org/review/3786
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-21 21:41:47 +00:00
Jeff Morriss a3d8f31ad0 Add a function to dissect an E.164 (MSISDN) number in UTF8 format and use it
in the Diameter dissector.

This new API adds a filter for the MSISDN as well as a subtree and filter for
the Country Code.

Change-Id: Ibcbf4b5f72178b7e4af63efa7496188d608a9de7
Reviewed-on: https://code.wireshark.org/review/3760
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-21 13:01:22 +00:00
Jeff Morriss 8fc0ee4c89 Decode IMSIs found in Subscription-Id AVPs.
Move decode of the User-Name AVP out of the 3GPP-specific file.
Add a couple of macros for 3GPP AppIDs (rather than using the number directly)
in both files.

Change-Id: I496b4ae86b05264462167b6e41ce1451392de11b
Reviewed-on: https://code.wireshark.org/review/3753
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-20 19:11:58 +00:00
Jeff Morriss 7cc8b7c16f Don't mark a used parameter as unused.
Also fix up some whitespace.

Change-Id: I7cd78740199ce7b2682902a5687c4f05c2c963b2
Reviewed-on: https://code.wireshark.org/review/3716
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-19 13:36:17 +00:00
Jeff Morriss 433eeda109 When checking if a message is Diameter also check for a minimum message length.
This improves the detection of Diameter messages within a TCP bytestream (i.e.,
when the Diameter PDUs don't neatly align with frames).

Bug: 10362
Change-Id: I49a6e8cf076a6ab8a14761493aab9f3b11e4756e
Reviewed-on: https://code.wireshark.org/review/3557
Petri-Dish: Evan Huus <eapache@gmail.com>
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-12 18:31:35 +00:00
Michael Mann 9d5f9141af Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the area.

Change-Id: Id8d957d3d68a2e3dd5089f490bd59d773e1be967
Reviewed-on: https://code.wireshark.org/review/3427
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-08-05 07:36:26 +00:00
AndersBroman 0f85608d3a Use wmem for application Ids
Remove soft deprecated APIs

Change-Id: Iecd2f552c1abb7bb2c6969073b3c245af22f4fcd
Reviewed-on: https://code.wireshark.org/review/3230
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-28 18:27:45 +00:00
AndersBroman ff01321da2 Sort diameter.applicationId fix a typo.
Change-Id: Id585371df929cdff17f98dddbebf063fa000ff56
Reviewed-on: https://code.wireshark.org/review/3229
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-28 17:36:37 +00:00
Kevin Cox 34e413f66d Make value_string_ext const-correct.
There is still some const-incorrect usage of them but those can be ironed
out after this change has been made.

Change-Id: Iba0631c804bdab34d7c0232b49967130e3370488
Reviewed-on: https://code.wireshark.org/review/3199
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>
2014-07-27 22:02:42 +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
Pascal Quantin b2af5b066a Convert a few dissectors with simple request/response tracking from red/black tree to hash map
Update the readme file accordingly

Change-Id: I056d1ab1f77df641b83fa9b3618b6c25d66e1a83
Reviewed-on: https://code.wireshark.org/review/1420
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-29 10:23:32 +00:00
Pascal Quantin ad33357e62 Exported PDU: add support for more than 32 tags
Change-Id: Idc9f105164919827a8a81c88b5a56de4fa25df0b
Reviewed-on: https://code.wireshark.org/review/1197
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-18 20:15:04 +00:00
Jeff Morriss 26dcdbb402 Tweak the Diameter heuristics a bit more.
Increase the max Diameter message size to 65534 and reject messages whose
flags have both the E- and R-bits set.

Change-Id: Ib11701a47d23ff042a346d59c56f9f0f4410e6b7
Reviewed-on: https://code.wireshark.org/review/990
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-07 04:12:13 +00:00
Jeff Morriss 5bb64c00b6 Strengthen the Diameter heuristics to avoid trying to reassemble enormous messages.
Fixes some heuristics mistakes pointed out in
http://ask.wireshark.org/questions/31227/diameter-reassembly-malformed-packets

Change-Id: Iffc97d46cee5dd532fec0031286927fbcb86c095
Reviewed-on: https://code.wireshark.org/review/949
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-04 00:11:12 +00:00
Pascal Quantin 488f2a0974 Exported PDU: add support for data length on the wire
Change-Id: Iff14ec4d0297ec85f3597b33871fb0ab5256a597
Reviewed-on: https://code.wireshark.org/review/728
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-19 05:13:30 +00:00
AndersBroman fcf1c44b50 Make the avp_str available to sub dissectors and Let the subdissector have
precedence filling in the avp_item string. Use that in a couple of places.

Change-Id: I1af7a1ca4c14fb56ddeaab336202e6c2a18e556b
Reviewed-on: https://code.wireshark.org/review/699
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-16 19:15:54 +00:00
AndersBroman 4b2ec6b335 Display framed_ipv6_prefix as an IPv6 address even when it's not the full
16 bits.

Change-Id: I6cef08e2da9467cb54b5d08526c77c87e7afe1fa
Reviewed-on: https://code.wireshark.org/review/645
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-14 14:33:41 +00:00
AndersBroman c9956e35f2 Use dissector_try_uint_new() and include diam_sub_dis_inf when calling all
AVP sub dissectors.

Change-Id: I6dcc362ea755794d3e18d8d27ed2128b46bd887b
Reviewed-on: https://code.wireshark.org/review/642
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-13 20:33:54 +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
Anders Broman 95ed1b4977 As spotted by Joerg; make a HFILL_INIT(hf) macro and use it to init the private part of the hf structure.
svn path=/trunk/; revision=54843
2014-01-19 09:40:04 +00:00
Anders Broman 493ba3e367 Try to fix warning: initializer element is not computable at load time.
svn path=/trunk/; revision=54832
2014-01-17 18:58:50 +00:00
Anders Broman a49fee443b Fix a bug intrduced in http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=54820
svn path=/trunk/; revision=54831
2014-01-17 18:55:49 +00:00
Anders Broman efbecb3e9a Fix a couple of
warning: initializer element is not computable at load time

svn path=/trunk/; revision=54820
2014-01-15 19:29:03 +00:00
Guy Harris c1b602584d Don't make promises of constness that we can't honor.
svn path=/trunk/; revision=54757
2014-01-14 03:24:37 +00:00
Anders Broman 21cc278905 Fix a typo.
svn path=/trunk/; revision=54597
2014-01-04 23:41:22 +00:00
Evan Huus adff2b3b50 Get rid of some useless intermediate ep-memory when building Diameter arrays.
svn path=/trunk/; revision=54421
2013-12-23 21:09:26 +00:00
Bill Meier ffb3264a99 #if 0 some unused #defines.
svn path=/trunk/; revision=54306
2013-12-20 16:03:24 +00:00
Jakub Zawadzki 2c015bb386 Fix some const/ not const warnings.
svn path=/trunk/; revision=54114
2013-12-15 12:35:00 +00:00
Jakub Zawadzki 5c79cbf152 Fix some trivial warnings.
svn path=/trunk/; revision=54085
2013-12-14 10:29:26 +00:00
Chris Maynard c5e358116c Reject the packet if data is NULL.
svn path=/trunk/; revision=53898
2013-12-10 03:25:04 +00:00
Jakub Zawadzki c67d38cf15 Rename base_display_* to field_display
This is preparation to support ->display for FT_STRING values.

svn path=/trunk/; revision=53820
2013-12-07 10:41:42 +00:00
Jörg Mayer 53394aca2c Fix
[  5%] Building C object epan/CMakeFiles/epan.dir/dissectors/packet-diameter.c.o
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-diameter.c: In function ‘dissect_diameter_avp’:
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-diameter.c:621:37: error: ‘avp_str’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (avp_str) proto_item_append_text(avp_item," val=%s", avp_str);
                                     ^
cc1: all warnings being treated as errors
make[2]: *** [epan/CMakeFiles/epan.dir/dissectors/packet-diameter.c.o] Error 1


svn path=/trunk/; revision=53787
2013-12-04 21:32:16 +00:00
Anders Broman 5c40dde043 "RFC 6733 [5] specifies the Experimental-Result AVP containing Vendor-Id AVP and Experimental-Result-Code AVP. The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 and contains a vendor-assigned value representing the result of processing a request."
This means we have to store the value of the Vendor Id AVP in the grouped  Experimental-Result AVP to be able to dissect the value of 
Experimental-Result-Code according to the vendor specified values(if known). This patch implements that with a dissector table to register vendor dissectors for the result code.

svn path=/trunk/; revision=53785
2013-12-04 20:55:52 +00:00
Bill Meier 7727623d8c Do some constification;
Create/use value_string_ext_free();
Display certain numbers also as hex in the
   "forced to fall back to linear search: ..." value-string warning msg
Add editor-modelines to some files;
Do some whitespace changes.

svn path=/trunk/; revision=53484
2013-11-21 18:46:40 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +00:00
Michael Mann 86951290ea Adjust when dissect_diameter_avp loop is called to avoid access violations.
from Lukasz Markowski

svn path=/trunk/; revision=52951
2013-10-29 15:18:05 +00:00
Michael Tüxen 9a2f5a2db2 Fix the compilation.
I guess this is what is meant. Only compile tested...

svn path=/trunk/; revision=52928
2013-10-28 18:59:33 +00:00
Michael Mann 5de5fe6cb1 Pass diam_sub_dis_t directly to the subdissectors instead of using pinfo->private_data.
svn path=/trunk/; revision=52919
2013-10-28 15:59:26 +00:00
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +00:00
Anders Broman 753afe5fa4 Fix UDP port range.
svn path=/trunk/; revision=51977
2013-09-12 18:17:41 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Evan Huus 48089ba4ca Use epan-scoped memory for building more of the diameter table stuff.
svn path=/trunk/; revision=51754
2013-09-04 21:06:56 +00:00
Michael Mann e597acdc48 Batch of filterable expert info.
svn path=/trunk/; revision=51625
2013-09-01 13:05:27 +00:00
Evan Huus 44c91cb02a More wmem.
svn path=/trunk/; revision=51617
2013-08-31 15:58:15 +00:00
Anders Broman 2a0b65b827 Make the UDP port preference a range.
svn path=/trunk/; revision=51521
2013-08-26 05:14:53 +00:00
Anders Broman d8e8f48636 Simplify adding and deletetion of port ranges by adding new methods.
If no one has any objection I'll edit the deocumentation later.

svn path=/trunk/; revision=51517
2013-08-25 18:48:26 +00:00
Anders Broman ba1bee9516 On request from Tommy Wu:
Enable Diameter over UDP dissection as there is an application using it.

svn path=/trunk/; revision=51473
2013-08-22 17:21:20 +00:00
Michael Mann a22331bbd2 Convert remaining proto_item_set_expert_flags in dissector directory.
svn path=/trunk/; revision=51142
2013-08-05 01:54:15 +00:00
Anders Broman 5e56e72953 Dissect S6 feature list.
svn path=/trunk/; revision=50796
2013-07-22 20:44:01 +00:00
Jeff Morriss 7d76eb0ad3 Catch exceptions from AVP subdissectors in case the AVPs following the one
that threw the exception are OK--this allows us to view as much of the message
as possible even when Wireshark doesn't like whatever was in a particular
AVP.

Instead of using the 'volatile' keyword to avoid variable-clobbering warnings,
put the exception-catching code in its own function with no local variables.

svn path=/trunk/; revision=50728
2013-07-18 15:08:15 +00:00