aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tpncp.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-10tpncp: replace stack variable with dynamic allocation.Dario Lombardo1-3/+1
The size of the stack triggers an error on clang: ../epan/dissectors/packet-tpncp.c:410:1: error: stack frame size of 26152 bytes in function 'init_tpncp_data_fields_info' [-Werror,-Wframe-larger-than=] init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, FILE *file) ^ 1 error generated. Change-Id: Ia7d1d609b339eff6ffa023d9c0bf47caf6bd9851 Reviewed-on: https://code.wireshark.org/review/35715 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-09TPNCP: Update from downstreamOrgad Shaneh1-445/+405
* Support little-endian systems * Improve error reporting * Implement some new features in the protocol Change-Id: I73e07a588c4a028fd0c22e1570adb7957ba2d52f Reviewed-on: https://code.wireshark.org/review/35467 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
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>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-1/+1
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-22tpncp: load hf array in the handoff functionMartin Kaiser1-32/+37
tpncp reads hf entries from a database. There's a boolean preference defining if the database is actually read. We can't access this preference until the preferences are initialized. The code as it is now wil always default to false and never read the database. Check the preference in the handoff function and initialize the hf entries if they are not yet initialized. Change-Id: I545a49a946b78e1a0bc23e9803eb671d8765bba4 Reviewed-on: https://code.wireshark.org/review/18386 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-07tpncp: use ws_strtou function.Dario Lombardo1-5/+11
Change-Id: Ic8e5c5abffe456ed7a48abf1de87d63665667759 Reviewed-on: https://code.wireshark.org/review/18105 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-05Initialize all header_field_info membersPascal Quantin1-6/+2
Change-Id: Id86d17f1e321b8cc73fb732aaf674e1420a0a745 Reviewed-on: https://code.wireshark.org/review/15737 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
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-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-1/+1
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-11-07Remove some unnecessary includes.Guy Harris1-3/+0
Either remove them completely, or put them inside an #ifdef. Change-Id: Iceff4909e250c17812f38d94e067f7c37ab72e1b Reviewed-on: https://code.wireshark.org/review/11630 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-13Remove deprecated API tvb_lengtRemove deprecated API tvb_lengthAndersBroman1-4/+4
Change-Id: Iea7dd7d13ce1a2ee375a2c4a75f897ba2c936921 Reviewed-on: https://code.wireshark.org/review/8048 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27Lua: Expose tcp_dissect_pdus() to LuaHadriel Kaplan1-1/+3
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>
2014-12-26Fix some dissectors doing termio (fprintf(stderr,..), g_warning()).Bill Meier1-7/+8
- 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-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-2/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-8/+4
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-09-08Eliminate proto_tree_add_text from some of the dissectors.Michael Mann1-16/+11
Other minor cleanups while in the area. Change-Id: I623d941e53128f169e55dfc629547b4221fa72fc Reviewed-on: https://code.wireshark.org/review/4021 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: Evan Huus <eapache@gmail.com>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-4/+4
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-4/+4
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-04Fix indent and add modelinesAlexis La Goutte1-45/+58
(Indent typo coming from 23d7d2ca2674565404262734f1a5855f83535c85) Change-Id: Ic4deae30d64db9f264223366d2d9d880708001d8 Reviewed-on: https://code.wireshark.org/review/956 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-03Add a preference to enable loading of the database. EffectivlyAndersBroman1-34/+47
dissabling the dissector. Defaulted to FALSE e.g dissebling the dissector. The usage of this dissector is limited and most people don't use it so it might as well be dissabled by default. See Bug 9569 for a discussion on the subject. Change-Id: I82f675bcf8ba37220105c98360195ea805aa7330 Reviewed-on: https://code.wireshark.org/review/939 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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>
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-10- Forward declaration of register functions.Anders Broman1-0/+3
svn path=/trunk/; revision=53918
2013-11-17Move the epan/filesystem.c routines to wsutil; they're not specific toGuy Harris1-1/+1
packet dissection, they're specific to the entire Wireshark suite of programs. svn path=/trunk/; revision=53377
2013-11-13Fix CID 1113411: close the file descriptor and free the file name even inJeff Morriss1-9/+14
error cases. svn path=/trunk/; revision=53301
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-6/+10
"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-10-26Cleanups to the TPNCP database parser/loader:Evan Huus1-21/+56
- use and free glib memory instead of ep_ memory - another dissector down - propogate errors correctly - produce a warning if an error occurs loading the DB - add XXX comments about realloc handling that may or may not be a memory leak in failure cases svn path=/trunk/; revision=52865
2013-09-15emem -> wmem (except uat or init routines)Pascal Quantin1-2/+4
svn path=/trunk/; revision=52087
2013-09-12Revert the TPNCP changes in r51972 until we can figure out a better way to fixEvan Huus1-11/+11
it. svn path=/trunk/; revision=51976
2013-09-12emem -> wmemJörg Mayer1-11/+11
svn path=/trunk/; revision=51972
2013-08-06Replace hfinfo pointer to same_name_prev, with same_name_prev_id.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=51175
2013-08-06Remove hfinfo->bitshift member, add hfinfo_bitshift() to get it.Jakub Zawadzki1-1/+0
svn path=/trunk/; revision=51174
2013-08-05Keep result of [new_]register_dissector in some dissectors. [2 of x]Jakub Zawadzki1-6/+7
(don't create new dissector handle if we can use already existing one) svn path=/trunk/; revision=51159
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-12/+10
svn path=/trunk/; revision=49923
2013-03-29Rename value string (and similar) functions to use a consistent pattern. ThisEvan Huus1-2/+2
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-18From beroset:Anders Broman1-8/+8
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48409
2013-02-04Comment out two more case of an unused hf[] entry.Bill Meier1-20/+24
svn path=/trunk/; revision=47463
2012-12-26Fix a bunch of warnings.Guy Harris1-1/+1
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-11-11Fix the rest of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6665Evan Huus1-5/+19
Catch exceptions thrown while registering the dynamically generated tpncp fields, and take that as a hint that the .dat file is corrupt. svn path=/trunk/; revision=46004
2012-11-11Fix part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6665Evan Huus1-2/+13
Make sure the array of names is always null-terminated, even if we have enough names to fill the entire thing. Also use a gboolean instead of a gint for one variable. svn path=/trunk/; revision=46003
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-08-25cleanup some unnecessary g_malloc callsMichael Mann1-7/+2
svn path=/trunk/; revision=44662
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-4/+4
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-02-27From Alex Rodikov via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6871Alexis La Goutte1-5/+8
TPNCP (proprietary Audiocodes) protocol dessector - wrong guint8 value presentation The presentation of unsigned 8-bit integer is wrong. The (signed) gint8 is used which is displayed as unsigned integer (by proto_tree_add_uint) afterwards. That causes wrong presentation of valus which bigger than 127. Solution: New guint8 is introduced to present unsigned 8 bit integer value. svn path=/trunk/; revision=41209
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-04-01Avoid potential buffer overruns when sscanf'ing strings.Chris Maynard1-2/+2
Should resolve CID's 656 and 657. svn path=/trunk/; revision=36432
2011-03-22Fix potential array overrun: Coverity CID #565.Bill Meier1-5/+10
svn path=/trunk/; revision=36258
2011-01-15Replace ip_to_str((tvb_get_ptr(...)) with tvb_ip_to_str().Jeff Morriss1-1/+1
Replace ip6_to_str((tvb_get_ptr(...)) with tvb_ip6_to_str(). svn path=/trunk/; revision=35540
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-6/+6
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