aboutsummaryrefslogtreecommitdiffstats
path: root/epan/strutil.h
AgeCommit message (Collapse)AuthorFilesLines
2011-04-13Change ws_strdup_escape_underscore() function to be more general, bysfisher1-8/+10
accepting any character as the escaped character. Change existing uses to use '_' for the underscore escaping. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36627 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-29Doxygen changes.etxrab1-3/+14
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33990 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-27From Edgar Gladkich:gerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32995 f5534014-38df-0310-8fa8-9805f1628bb7
2010-01-26Move underscore escaping/unscaping function to strutil.c;dimeg1-0/+16
Update decoding of IS-801 Request GPS Acquisition Assistance git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31685 f5534014-38df-0310-8fa8-9805f1628bb7
2009-10-23Move IA5_7BIT_decode to strutil.cetxrab1-0/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30669 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-19From Didier Gautheron:etxrab1-0/+3
Part 2 Extracted from optimizations patch http://wiki.wireshark.org/Development/Optimization Optimize expert info. Slightly changed by me. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29478 f5534014-38df-0310-8fa8-9805f1628bb7
2009-03-30Add a couple of size_t casts to packet-dnp.c.gerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27891 f5534014-38df-0310-8fa8-9805f1628bb7
2009-02-17Add a string utility function "string_or_null" which can be used togerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27478 f5534014-38df-0310-8fa8-9805f1628bb7
2008-04-29Get rid of old GLib 1.2[.x] stuff, as we now require GLib 2.x.guy1-25/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25192 f5534014-38df-0310-8fa8-9805f1628bb7
2007-11-06add a g_byte_array_sized_new() helper if we compile for glib < 2sahlberg1-0/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23373 f5534014-38df-0310-8fa8-9805f1628bb7
2007-10-27Apply yet another set of the optimization patches:etxrab1-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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23285 f5534014-38df-0310-8fa8-9805f1628bb7
2007-10-26Apply yet another set of the optimization patches:etxrab1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23273 f5534014-38df-0310-8fa8-9805f1628bb7
2007-02-07From: Gisle Vanemlego1-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?) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20734 f5534014-38df-0310-8fa8-9805f1628bb7
2007-01-11Fix compilation problems under Windows. In the GTK code, convert SSIDsgerald1-1/+17
to GByteArrays. Add format_uri() to strutil, which formats a byte string with percent-escapes. Fixup whitespace and indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20397 f5534014-38df-0310-8fa8-9805f1628bb7
2007-01-11Add uri_str_to_bytes(), byte_array_dup(), and byte_array_equal()gerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20388 f5534014-38df-0310-8fa8-9805f1628bb7
2006-12-29gtk1 does not provide g_ascii_isxdigit so provide it through strutil.h insteadsahlberg1-1/+7
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20233 f5534014-38df-0310-8fa8-9805f1628bb7
2006-09-22Add support for reading from stdin under Windows. Based on a patch sentgerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19291 f5534014-38df-0310-8fa8-9805f1628bb7
2006-06-19New rutine tvb_format_text_wsp() which will change "whiite space" characters ↵etxrab1-0/+2
to space before output. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18519 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21name changesahlberg1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18197 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-08Use Unicode for all native Win32 calls. Unicode Windows applicationsgerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17534 f5534014-38df-0310-8fa8-9805f1628bb7
2006-02-23create a real function to emulate g_strlcat() for GTK<2sahlberg1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17392 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-02new field type FT_OID for OBJECT IDENTIFIERskukosa1-0/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16652 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-17g_strlcat() and g_ascii_isprint() don't exist in GTK+ at all - theyguy1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16522 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-16add a g_ascii_isprint() macro so that this symbol can be used for gtk1 ↵sahlberg1-0/+8
platforms as well git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16519 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-16 add a simple g_strlcat define in strutil for gtk==1 where this symbol ↵sahlberg1-0/+12
does not exist git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16511 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-27fix doxygen tagsulfl1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12404 f5534014-38df-0310-8fa8-9805f1628bb7
2004-08-13Move convert_string_to_hex() and convert_string_case() from gtk/find_dlg.cgerald1-0/+19
to epan/strutil.c git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11733 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-06Add a "force_separators" parameter to hex_str_to_bytes so that it'sgerald1-4/+85
possible to paste in WEP keys without any separators. Add doxygen comments to strutil.h. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11123 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-01Add an XML escaping routine: xml_escape()obiot1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10759 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25Change the first arg to hex_str_to_bytes from guchar* -> char*jmayer1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9842 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-29"hex_str_to_bytes()" modifies the GByteArray supplied to it, so don'tguy1-2/+2
mark it as "const". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9474 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-29Pull most of bytes_from_unparsed() into a new routine,gerald1-1/+2
hex_str_to_bytes(). Use the new routine to initialize any WEP keys we have defined. This has the side effect of fixing an overflow if the user entered a long WEP key. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9471 f5534014-38df-0310-8fa8-9805f1628bb7
2003-08-27Add a "contains" operator for byte-strings, strings, and tvbuffs (protocols).gram1-1/+4
The search uses a naive approach; more work is required to add a Boyer-Moore Search algorithm. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8280 f5534014-38df-0310-8fa8-9805f1628bb7
2003-07-04Use FLT_DIG and DBL_DIG from float.h to create printf-style print formatgram1-1/+6
for FT_FLOAT and FT_DOUBLE values. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7962 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-4/+4
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6116 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hjmayer1-14/+6
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c and inet_ntop.c for now (can't estimate the consequences). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5928 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-23WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3'sguy1-5/+4
<packet32.h> includes <winsock2.h>; we include that rather than <winsock.h>, to avoid errors due to conflicting declarations in <winsock.h> and <winsock2.h>. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5742 f5534014-38df-0310-8fa8-9805f1628bb7
2000-12-22Enable FT_BYTES dfiltering, from Ed Warnicke.gram1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2768 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-13Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just aguy1-2/+2
string formatter, like "format_text()", and, as "tvbuff.c" now calls it (*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h" in just to declare "bytes_to_str()". It's now declared in "strutil.h", so include it in modules that use "bytes_to_str()" and weren't already including it. Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a pointer to a chunk of N bytes at a given offset in a tvbuff and then hands that chunk to "bytes_to_str()". Convert the code that was doing that to use "tvb_bytes_to_str()" instead (which caught what I suspect is a bug in the Q.2931 dissector, where it was handing an offset of 0 to "tvb_get_ptr()" - a cut-and-pasteo, I think). Tvbuffify the ARP dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2634 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-10Tvbuffify the SAP and SDP dissectors.guy1-3/+1
Add "tvb_find_line_end_unquoted()" for the benefit of the SDP dissector; get rid of "find_line_end_unquoted()" as nobody uses it any more. Add "tvb_pbrk_guint8()" for the benefit of "tvb_find_line_end_unquoted()"; it searches for any of a number of characters, unlike "tvb_find_guint8()" which searches for only one. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2595 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-09Support for embedded newlines in SDP fields, from Robert Tsai.guy1-1/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2584 f5534014-38df-0310-8fa8-9805f1628bb7
2000-09-28More EPAN-related code movements. Get rid of usage of #include "globals.h"gram1-3/+3
and #include "util.h" from epan code. Move get_home_dir() into epan/filesystem.c as it's used by plugins.c. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2461 f5534014-38df-0310-8fa8-9805f1628bb7
2000-09-27First step in moving core Ethereal routines to libepan.gram1-0/+46
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2458 f5534014-38df-0310-8fa8-9805f1628bb7