summaryrefslogtreecommitdiff
path: root/epan/oids.c
AgeCommit message (Collapse)AuthorFilesLines
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>
2017-03-11oids: fix this statement may fall through [-Werror=implicit-fallthrough] ↵Alexis La Goutte1-0/+4
found by gcc7 Change-Id: I8f84414be693ea8ebcfef003480e9ee05de94ea0 Reviewed-on: https://code.wireshark.org/review/20495 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-12uat: add a reset callback.Dario Lombardo1-0/+2
This function will free the resources allocated by the caller. Change-Id: Ib486c14e4fd3c321662fb71f7fd06733ce9a64a4 Reviewed-on: https://code.wireshark.org/review/19375 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-22Improve name resolution preference tooltips.Jaap Keuter1-6/+10
Change the tooltips texts to make them better describe the preference. Bug: 13130 Bug: 13131 Change-Id: Ie753e3703a702bdafed91cf0f41b306347088526 Reviewed-on: https://code.wireshark.org/review/18878 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-08-02Fix checkAPI warning for printf.Michael Mann1-1/+2
Another legitimate use, so use ws_debug_printf. Change-Id: I9bebe01e80987caf8e18a59b93a48f9a2d6ee397 Reviewed-on: https://code.wireshark.org/review/16835 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-08-02Remove trailing "." from OID strings.Guy Harris1-0/+5
The previous change removed code that did that. Change-Id: If297018f5902af7a2d9cacb0cc9a5f1ffe1e1d00 Reviewed-on: https://code.wireshark.org/review/16834 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-31oids.c: Use wmem_strbuf instead of trying to accommodate snprintf.Michael Mann1-17/+6
Change-Id: I5222fbd07b7d1301386f7a206fef688793dd6be7 Reviewed-on: https://code.wireshark.org/review/16802 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-07Use faster string functions at startup.Gerald Combs1-4/+13
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-01-07Remove constness from bytestring_to_str() [-Wcast-qual]João Valverde1-1/+1
Change-Id: I7f942787dfdc4f76dd0ad5111d1eb528b20f0ba9 Reviewed-on: https://code.wireshark.org/review/13011 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: João Valverde <j@v6e.pt>
2015-08-04MIB/OID Fix assertion in proto.c tmp_fld_check_assert().AndersBroman1-1/+1
It seems like oid_data->name may get freed so do a g_strdup() as it's done for hf.hfinfo.abbrev. Change-Id: Ie05fb42d59556aec300d4e007b1db5cc79d8d6f1 Reviewed-on: https://code.wireshark.org/review/9864 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-09(Trivial) Fix printf-related 'Mismatch on sign' warningsBill Meier1-4/+4
Found by MSVC2013 Code Analysis Change-Id: I58063946dd558e98308c87b36eeac0ddbe1a6e79 Reviewed-on: https://code.wireshark.org/review/7045 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-23oids: fix memory leakEvan Huus1-1/+4
In oid_encoded2subid_sub(), the scope we get may be NULL, in which case if we don't return our allocated buffer, it is our responsibility to free it. Minor regression from ge333e4c90f0aca41b0a56cef22fd80d0b0e73e14. Bug: 10883 Change-Id: I324ca770278ab0575511c5e9ab72b70d6ac1a391 Reviewed-on: https://code.wireshark.org/review/6748 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-19Convert OID APIs to use wmem.Michael Mann1-89/+126
There are a few oid functions that are only called in oids_test.c. I'll presume the APIs are used in proprietary dissectors rather than just remove them. Change-Id: I4595e00f93bf9ab8cf2493fe0432b91960f55a3f Reviewed-on: https://code.wireshark.org/review/6592 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-13Consistently use the "g_string_free returns a C string pointer" idiom.Guy Harris1-4/+1
g_string_free(str, FALSE) frees the GString container but not the underlying g_malloc()ed string; instead, it returns a pointer to the g_malloc()ed string. Fix those places that didn't already get the string pointer from g_string_free() to do so rather than manually extracting the string themselves. And fix one place that didn't even need to use a string - it was just scanning a C string without even modifying it. Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5 Reviewed-on: https://code.wireshark.org/review/6532 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-07Remove bytestring_to_ep_strMichael Mann1-3/+5
Use wmem equivalent bytestring_to_str Change-Id: I1ec7509e3adb36ab0f65317459653cb3b4b11af8 Reviewed-on: https://code.wireshark.org/review/6368 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-29Remove some proto_tree_add_text outside the dissector directory.Michael Mann1-3/+3
Change-Id: I890846a0cede755a603243b4048fb5c917b2826b Reviewed-on: https://code.wireshark.org/review/6112 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-28Use g_ascii_isalnum() rather than isalnum().Guy Harris1-2/+1
Only *ASCII* alphanumerics are allowed in filterable field names, so use g_ascii_isalnum() to check for them. That avoids issues with characters with the 8th bit set and avoids locale-dependent behavior. Change-Id: I4e3c4eec907f5e576629229fcf154fcf728b7a2e Reviewed-on: https://code.wireshark.org/review/4973 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-11Fix unused variable warnings found by clang.Gerald Combs1-0/+3
Change-Id: I31ff6d9bfcedfc1e3cab4e191d8dbf8de347abb1 Reviewed-on: https://code.wireshark.org/review/1065 Reviewed-by: Gerald Combs <gerald@wireshark.org>
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>
2014-02-25Remove trailing whitespaceBill Meier1-3/+3
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0 Reviewed-on: https://code.wireshark.org/review/385 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-01-19As spotted by Joerg; make a HFILL_INIT(hf) macro and use it to init the ↵Anders Broman1-11/+4
private part of the hf structure. svn path=/trunk/; revision=54843
2014-01-14Don't cast away constness.Guy Harris1-6/+6
svn path=/trunk/; revision=54800
2014-01-06Fix a typo.Anders Broman1-1/+1
svn path=/trunk/; revision=54617
2014-01-06Try to fix warning: initializer element is not computable at load time.Anders Broman1-19/+34
svn path=/trunk/; revision=54616
2013-12-23First round converting OIDs from emem to wmem. Just internal functions so far.Evan Huus1-19/+29
svn path=/trunk/; revision=54420
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-3/+3
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
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-10-26Fix several [-Wunused-const-variable] warnings (using '#if 0').Bill Meier1-0/+2
svn path=/trunk/; revision=52866
2013-10-19Add OID unit tests. Bug 9294 ↵Michael Mann1-4/+10
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9294) From Ed Beroset svn path=/trunk/; revision=52692
2013-10-16If the length we allocated was 0, don't try and write to the returned pointer.Evan Huus1-5/+9
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9276 svn path=/trunk/; revision=52655
2013-10-15Fix a length check in the OID code, we add an extra byte if is_first, not theEvan Huus1-1/+3
other way around. Also add an assert so it blows up if we get it wrong, rather than leading to uninitialized memory. Fixes the last errors I can find in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9268 svn path=/trunk/; revision=52615
2013-10-10From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9246Evan Huus1-15/+7
Fix memory leaks and bad memory accesses in c1222 dissector. From me: use realloc in a handoff function since it may get called multiple times, and we only need the latest. svn path=/trunk/; revision=52497
2013-10-08Don't try and construct an OID string if the len is zero. FixesEvan Huus1-3/+6
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9246 svn path=/trunk/; revision=52455
2013-10-06Add support for RELATIVE-OID ASN.1 type. Bug 9192 ↵Michael Mann1-3/+27
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192) From Ed Beroset. svn path=/trunk/; revision=52393
2013-09-25From beroset@mindspring.com:Anders Broman1-1/+1
oid_subid2encoded generates faulty encodings for 3-, 4- and 5-byte subid values https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9188 svn path=/trunk/; revision=52219
2013-09-12Use epan-scope memory for OIDs, cleaning up another ~100KB of valgrindEvan Huus1-11/+4
complaints. svn path=/trunk/; revision=51966
2013-09-04Remove what appear to be the last two instances of pe_tree. Could this be theEvan Huus1-5/+5
first emem API to die? svn path=/trunk/; revision=51756
2013-07-15Restore inclusion of report_err.hJeff Morriss1-0/+2
svn path=/trunk/; revision=50599
2013-07-15Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific ↵Jeff Morriss1-1/+0
there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark). svn path=/trunk/; revision=50598
2013-07-14Fix the OID registration leaks.Evan Huus1-7/+9
Only 1,625 bytes to go... svn path=/trunk/; revision=50565
2013-06-12Pretify dissection of date and Time.Anders Broman1-1/+2
svn path=/trunk/; revision=49905
2013-06-11Show DisplayString as a string.Anders Broman1-1/+1
svn path=/trunk/; revision=49887
2013-04-09Don't try to open <home>/.wireshark on Windows: Wireshark hasn't written toJeff Morriss1-5/+5
that directory since 2001 and reading from that directory was only left in for backwards compatibility with versions prior to r4702. I think it's now safe to remove that backwards compatibility. This eliminates the last argument of get_persconffile_path(). https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8437 svn path=/trunk/; revision=48797
2013-03-21[-Wmissing-prototypes]Anders Broman1-7/+7
Use explicit casts. svn path=/trunk/; revision=48457
2013-03-15From beroset:Anders Broman1-14/+14
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48311
2013-01-14Fixing CID 280433 and 280357.Jaap Keuter1-8/+4
Also strengthening the checking and debug presentation. svn path=/trunk/; revision=47060
2012-12-26Fix a bunch of warnings.Guy Harris1-3/+3
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-10-27Do free overwritten names when registering oids. There was a comment claimingEvan Huus1-2/+8
we couldn't since the name might not be on the heap, but it looks to me like we're always careful to put it on the heap via a g_strdup if necessary. Fixes some minor memory leaks. svn path=/trunk/; revision=45814
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45016
2012-08-12Safely handle empty OIDs and other weird cases where we can't find a sub-id.Evan Huus1-0/+9
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7219 svn path=/trunk/; revision=44460