aboutsummaryrefslogtreecommitdiffstats
path: root/epan/strutil.h
AgeCommit message (Collapse)AuthorFilesLines
2018-02-08epan: use SPDX indentifiers.Dario Lombardo1-13/+1
Skipping dissectors dir for now. Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa Reviewed-on: https://code.wireshark.org/review/25694 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-31Add wmem allocator parameter to format_uriMichael Mann1-1/+2
Change-Id: Ic6de84a37b501e9c62a7d37071b2b081a1a1dd50 Reviewed-on: https://code.wireshark.org/review/19885 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-31format_text_wmem -> format_textMichael Mann1-13/+1
All cases of the "original" format_text have been handled to add the proper wmem allocator scope. Remove the "original" format_text and replace it with one that has a wmem allocator as a parameter. Change-Id: I278b93bcb4a17ff396413b75cd332f5fc2666719 Reviewed-on: https://code.wireshark.org/review/19884 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-31Add format_text_wmem.Michael Mann1-0/+13
This allows for a wmem_allocator for users of format_text who want it (dissectors for wmem_packet_scope()). This lessens the role of current format_text functionality in hopes that it will eventually be replaced. Change-Id: I970557a65e32aa79634a3fcc654ab641b871178e Reviewed-on: https://code.wireshark.org/review/19855 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-30Have format_text_wsp use wmem allocated memory.Michael Mann1-1/+2
format_text_wsp is fed into by tvb_format_text_wsp and tvb_format_stringzpad_wsp so those functions need to add a wmem allocated parameter as well. Most of the changes came from tvb_format_text_wsp and tvb_format_stringzpad_wsp being changed more so than format_text_wsp. Change-Id: I52214ca107016f0e96371a9a8430aa89336f91d7 Reviewed-on: https://code.wireshark.org/review/19851 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-30Have format_text_chr use wmem allocated memory.Michael Mann1-1/+4
Change-Id: Idcea59f6fc84238f04d9ffc11a0088ef97beec0c Reviewed-on: https://code.wireshark.org/review/19844 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-01-20Fix constnessJoão Valverde1-1/+1
Change-Id: I29723dae83373768edd254c60e48a717abf20694 Reviewed-on: https://code.wireshark.org/review/13436 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>
2014-04-17Add tvb_get and proto_tree_add for string-encoded byte arraysHadriel Kaplan1-1/+29
This commit adds tvb_get_string_bytes and proto_tree_add_bytes_item routines for getting GByteArrays fields from the tvb when they are encoded in ASCII hex string form. The proto_tree_add_bytes_item routine is also usable for normal binary encoded byte arrays, and has the advantage of retrieving the array values even if there's no proto tree. It also exposes the routines to Lua, both so that a Lua script can take advantage of this, but also so I can write a testsuite to test the functions. Change-Id: I112a038653df6482a5d0ebe7c95708f207319e20 Reviewed-on: https://code.wireshark.org/review/1158 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
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-13Fix warnings + remove some v. old comment from strutil.hJakub Zawadzki1-2/+0
svn path=/trunk/; revision=54078
2013-12-02Fix (-W)documentation error found by ClangAlexis La Goutte1-1/+1
../../epan/strutil.h:95:11: error: parameter 'line' not found in the function declaration [-Werror,-Wdocumentation] * @param line A pointer to the input string ^~~~ ../../epan/strutil.h:95:11: note: did you mean 'string'? * @param line A pointer to the input string ^~~~ string svn path=/trunk/; revision=53721
2013-11-12Fix typo (for generated Documentation)Alexis La Goutte1-1/+1
svn path=/trunk/; revision=53268
2013-11-10Move prototype of bytes_to_str, bytes_to_str_punct to correct header.Jakub Zawadzki1-24/+0
svn path=/trunk/; revision=53214
2013-11-09Replace STRINGIFY with glib version.Jakub Zawadzki1-4/+0
svn path=/trunk/; revision=53193
2013-11-09Remove comment (leftovers from r49444) + add missing WS_DLL_PUBLIC for adler32Jakub Zawadzki1-4/+0
(modifing files to be commited when svn commit is already running is no good). svn path=/trunk/; revision=53192
2013-10-12From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9229Evan Huus1-0/+16
Add a new strutil function format_text_chr that replaces unprintable characters with a single passed-in char (eg a '.' or a '-') instead of a C-style escape. This is useful for displaying binary data that frequently but not always contains text; otherwise the number of C escape codes makes it unreadable. svn path=/trunk/; revision=52563
2013-10-06Add support for RELATIVE-OID ASN.1 type. Bug 9192 ↵Michael Mann1-0/+11
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192) From Ed Beroset. svn path=/trunk/; revision=52393
2013-05-20Make the minimum supported GLib version 2.16.Gerald Combs1-5/+0
svn path=/trunk/; revision=49444
2013-05-03Add WS_DLL_PUBLIC to all functions declared here.Guy Harris1-0/+6
svn path=/trunk/; revision=49150
2013-04-26Fix a whole bunch of doxygen warnings, mostly typos or renamed parameters.Evan Huus1-2/+2
svn path=/trunk/; revision=49053
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-0/+20
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2013-02-26Fix spelling/typos found using a list of commonly misspelled words.Bill Meier1-3/+3
The misspellings were mostly in comments but some were in text strings visible to the user. svn path=/trunk/; revision=47899
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-10-22g_strcmp0 first occures in GLIB 2.16 define it localy if it does not existAnders Broman1-0/+8
to make builds on Fedora 8 with GTK 2.12 work. svn path=/trunk/; revision=45707
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-12-29Add 'extern "C"' wrappers and #include guards to various header files.Gerald Combs1-0/+8
svn path=/trunk/; revision=40321
2011-04-13Change ws_strdup_escape_underscore() function to be more general, byStephen Fisher1-8/+10
accepting any character as the escaped character. Change existing uses to use '_' for the underscore escaping. svn path=/trunk/; revision=36627
2010-08-29Doxygen changes.Anders Broman1-3/+14
svn path=/trunk/; revision=33990
2010-05-27From Edgar Gladkich:Gerald Combs1-0/+11
This is an extension to the Wireshark context sensitive protocol help. Rows in TreeView window are analyzed and suitable help file (as HTML) is opened in a browser. The help part (large file, 23 MB) of the Protocol Help can be downloaded under www.inacon.com/dowload/stuff/protocol_help.tar.gz This protocol help "light" provides descriptive content for the most frequently used standard protocols, including IP, TCP or SMTP. From me: Changes: Rename "ph_" in some function names to "proto_help_". Move the protocol help code to its own module. Make a bunch of functions static. Remove unused code. Use browser_open_url() instead of a custom function. Increase the logging levels. Don't clobber the normal log handler. Update some Doxygen comments to match the format in the rest of the code base. Removed GTK version checks. We've been 2.x only for a while. Move ph_replace_string to string_replace() in epan/strutil.[ch]. Fix a bunch of memory leaks. Add a NULL pointer check. Reformat the overview menu label. Document the file format and locations. Add Edgar to AUTHORS. svn path=/trunk/; revision=32995
2010-01-26Move underscore escaping/unscaping function to strutil.c;Gerasimos Dimitriadis1-0/+16
Update decoding of IS-801 Request GPS Acquisition Assistance svn path=/trunk/; revision=31685
2009-10-23Move IA5_7BIT_decode to strutil.cAnders Broman1-0/+3
svn path=/trunk/; revision=30669
2009-08-19From Didier Gautheron:Anders Broman1-0/+3
Part 2 Extracted from optimizations patch http://wiki.wireshark.org/Development/Optimization Optimize expert info. Slightly changed by me. svn path=/trunk/; revision=29478
2009-03-30Add a couple of size_t casts to packet-dnp.c.Gerald Combs1-2/+2
Make the length arguments of format_text() and format_text_wsp() size_t's, since it's natural to use strlen() for that. svn path=/trunk/; revision=27891
2009-02-17Add a string utility function "string_or_null" which can be used toGerald Combs1-0/+7
guarantee a non-null string value. Use it in the LDAP dissector. Fixes the crash on Windows (and other platforms) reported in bug 3262. svn path=/trunk/; revision=27478
2008-04-29Get rid of old GLib 1.2[.x] stuff, as we now require GLib 2.x.Guy Harris1-25/+0
svn path=/trunk/; revision=25192
2007-11-06add a g_byte_array_sized_new() helper if we compile for glib < 2Ronnie Sahlberg1-0/+5
svn path=/trunk/; revision=23373
2007-10-27Apply yet another set of the optimization patches:Anders Broman1-1/+1
- Use a fast path for the most common use of tvb_get_xxx functions: offset is >= 0 and tvb->real_data is set (this one is always true). - match_strval() is a linear search, put the most common protocols TCP/UDP/RDP first. - fix gtk1 g_strlcat declaration Use g_strlcat svn path=/trunk/; revision=23285
2007-10-26Apply yet another set of the optimization patches:Anders Broman1-0/+1
Replace strncpy with g_strlcpy. Add g_strlcat for GTK1 and don't use g_snprintf in GTK1 g_strlcpy printf family is very slow. svn path=/trunk/; revision=23273
2007-02-07From: Gisle VanemLuis Ontanon1-0/+10
The file epan/dissectors/packet-k12.c uses the function strcasestr() which is not available on e.g. Windows. So I cooked up a patch to epan/strutil.c to add epan_strcasestr() (is there a more suited place for such a function?) svn path=/trunk/; revision=20734
2007-01-11Fix compilation problems under Windows. In the GTK code, convert SSIDsGerald Combs1-1/+17
to GByteArrays. Add format_uri() to strutil, which formats a byte string with percent-escapes. Fixup whitespace and indentation. svn path=/trunk/; revision=20397
2007-01-11Add uri_str_to_bytes(), byte_array_dup(), and byte_array_equal()Gerald Combs1-1/+35
functions to strutil. Use GByteArrays to store SSIDs for decryption, and let the user specify arbitrary byte strings using percent-encoded strings. We should probably add percent encoding for pass phrases as well, so you can escape the ":" character. Move the key struct key conversion utilities to airpdcap.c, and remove duplicate code from packet-ieee80211.c. Fix a lot of indentation. svn path=/trunk/; revision=20388
2006-12-29gtk1 does not provide g_ascii_isxdigit so provide it through strutil.h insteadRonnie Sahlberg1-1/+7
svn path=/trunk/; revision=20233
2006-09-22Add support for reading from stdin under Windows. Based on a patch sentGerald Combs1-24/+2
in last year by Gianluca Varenni. Add partial support for reading from named pipes (currently disabled). Move utf_8to16() and utf_16to8() to a separate module (unicode-utils.[ch]) so that we don't have to cut and paste code in dumpcap.c. Fix up whitespace. svn path=/trunk/; revision=19291
2006-06-19New rutine tvb_format_text_wsp() which will change "whiite space" characters ↵Anders Broman1-0/+2
to space before output. svn path=/trunk/; revision=18519
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-03-08Use Unicode for all native Win32 calls. Unicode Windows applicationsGerald Combs1-0/+22
use UTF-16 internally and GTK+ 2.x uses UTF-8, which means we have to do a lots of conversions. Add utf_8to16() and utf_16to8 convenience functions to strutil.c. svn path=/trunk/; revision=17534
2006-02-23create a real function to emulate g_strlcat() for GTK<2Ronnie Sahlberg1-8/+1
so that the linker will find it. This eliminates the need to include strutil.h (where this was previously a macro) in all callers of this function. svn path=/trunk/; revision=17392
2005-12-02new field type FT_OID for OBJECT IDENTIFIERsTomas Kukosa1-0/+9
svn path=/trunk/; revision=16652
2005-11-17g_strlcat() and g_ascii_isprint() don't exist in GTK+ at all - theyGuy Harris1-5/+5
exist in GLib 2.x, but not in 1.2[.x]. Check the version number of GLIB, not of GTK+, to decide whether to #define them. svn path=/trunk/; revision=16522
2005-11-16add a g_ascii_isprint() macro so that this symbol can be used for gtk1 ↵Ronnie Sahlberg1-0/+8
platforms as well svn path=/trunk/; revision=16519