aboutsummaryrefslogtreecommitdiffstats
path: root/epan/to_str.h
AgeCommit message (Collapse)AuthorFilesLines
2014-07-06Add printf-format annotations, fix garbagePeter Wu1-1/+1
The WRETH dissector showed up some garbage in the column display. Upon further inspection, it turns out that the format string had a trailing percent sign which caused (unsigned)-1 to be returned by g_printf_string_upper_bound (in emem_strdup_vprintf). Then ep_alloc is called with (unsigned)-1 + 1 = 0 memory, no wonder that garbage shows up. ASAN could not even catch this error because EP is in charge of this. So, start adding G_GNUC_PRINTF annotations in each header that uses the "fmt" or "format" paramters (grepped + awk). This revealed some other errors. The NCP2222 dissector was missing a format string (not a security vuln though). Many dissectors used val_to_str with a constant (but empty) string, these have been replaced by val_to_str_const. ASN.1 dissectors were regenerated for this. Minor: the mate plugin used "%X" instead of "%p" for a pointer type. The ncp2222 dissector and wimax plugin gained modelines. Change-Id: I7f3f6a3136116f9b251719830a39a7b21646f622 Reviewed-on: https://code.wireshark.org/review/2881 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16Convert more time_to_str functions to wmemEvan Huus1-2/+2
Change-Id: Ibaae0e79935dc62f12f713f2df5b57d0f3f799b9 Reviewed-on: https://code.wireshark.org/review/2254 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-5/+5
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-15Fix declaration to match definition.Guy Harris1-1/+1
Change-Id: I9fcfddb34b2a22c3e2cf8f8fc9671eed2e8aef43 Reviewed-on: https://code.wireshark.org/review/1649 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15Get rid of some uses of tvb_get_ptr().Guy Harris1-0/+1
Introduce a new tvb_ipxnet_to_string() routine to help that. Change-Id: Icb27f7cdd6e6e7de67e765715e450063d7de6072 Reviewed-on: https://code.wireshark.org/review/1647 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-19Don't se_ allocate strings when mapping addresses to column strings.Guy Harris1-1/+0
This should significantly reduce memory usage, without increasing the CPU time required to process a capture file in TShark or Wireshark. As a result, se_address_to_str() is no longer used; eliminate it. Fixes bug #9949. Change-Id: I65a112a426c82cc73a957b81384c765c3d14f2c3 Reviewed-on: https://code.wireshark.org/review/1213 Reviewed-by: Evan Huus <eapache@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>
2014-02-03Fix all -fstrict-alias warnings found by gcc 4.1.2Gilbert Ramirez1-0/+2
The majority of the fixes are for calls to uat_new(). Instead of having each caller cast its private data to (void**), we use void* in the uat_new() API itself. Inside uat_new(), we cast the void* to void**. Some dissectors use val64_string arrays, so a VALS64() macro was added for those, to avoid using VALS(), which is useful only for value_string arrays. packet-mq.c was changed because dissect_nt_sid() requires a char**, not a guint**. All other callers of dissect_nt_sid() use char*'s (and take the address of it) for their local storage. So, this was changed to follow the other practices. A confusion between gint and absolute_time_display_e in packet-time.c was cleared up. The ugliest fix is the addition of ip6_guint8_to_str(), for exactly one caller. The caller uses one type of ip6 address byte array, while ip6_to_str() expects another. This new function is in place until the various address implementations can be consolidated. Add VALS64() to the developer documentation. Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805 Reviewed-on: https://code.wireshark.org/review/48 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-01-14Have ip6_to_str() and tvb_ip6_to_str() return const pointers, as theGuy Harris1-2/+2
ip_to_str equivalents do. Don't cast away constness, and don't make it necessary to do so. svn path=/trunk/; revision=54767
2013-12-19Add bytestring_to_str() which takes a wmem scope and is otherwise identical toEvan Huus1-0/+3
bytestring_to_ep_str (now deprecated). Use the new one in a few obvious places. Also just print directly to the buffer when loading ethernet addresses for resolution. The straight-to-buffer bytes_to_hexstr seems useful, maybe it shouldn't be in a private header... svn path=/trunk/; revision=54270
2013-12-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-11/+8
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-5/+5
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-23Implement address_to_str which is like ep_address_to_str and se_address_to_strEvan Huus1-1/+3
except it takes a wmem scope instead. Add the two emem equivalents to checkAPI as (weakly) deprecated. svn path=/trunk/; revision=53528
2013-11-23Remove old (2009) and no-longer-necessary compatibility macro.Evan Huus1-2/+0
svn path=/trunk/; revision=53527
2013-11-10Move prototype of bytes_to_str, bytes_to_str_punct to correct header.Jakub Zawadzki1-1/+24
svn path=/trunk/; revision=53214
2013-08-30Add an item tracer to the TCP stream graph. Enable packet selection.Gerald Combs1-0/+8
QCustomPlot data sets are made up of keys (x axis by default) and values (y axis). It looks like we can have multiple values for a given key (i.e. we can show multiple sequence numbers for a given timestamp) but QCPItemTracers can only be positioned by a key and not a key+value pair. This makes our graph selection behavior a bit different compared to the GTK+ version. We can only select one segment for a give timestamp but our selection targets are much larger (the height of the graph). Add a map for segment data so we don't have to iterate to find them. Use UTF8_RIGHTWARDS_ARROW where appropriate. Set a window title. Tell the user what will happen if he or she clicks. Disable graph selection. svn path=/trunk/; revision=51604
2013-06-25Move a couple of time-related modules into wsutil.Jeff Morriss1-1/+1
A bunch of files didn't really need to include these header files so remove the include line rather than changing it. svn path=/trunk/; revision=50154
2013-06-17More PDU export work:Pascal Quantin1-0/+2
- add automatic export of port type when exporting a source / destination port - add export of SCTP PPID (usefulness to be checked) - fix some field size svn path=/trunk/; revision=49989
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-31/+32
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2012-12-26Fix a bunch of warnings.Guy Harris1-6/+6
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-08-02From Richard Stearn: support for AX.25, including support forGuy Harris1-0/+2
LINKTYPE_AX25. svn path=/trunk/; revision=44211
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-04-04Make bit_offset in _tvb_get_bits64 and related functions unsigned. ThisGerald Combs1-1/+1
removes a potential buffer overflow and should fix a bunch of Coverity errors mentioned in bug 6878. We might want to do the same for no_of_bits. svn path=/trunk/; revision=41945
2011-05-08Add FT_EUI64 Field TypeAlexis La Goutte1-0/+3
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector * Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name * Update Documentation (README.dev) * Add new function in libwireshark.def * Support of encoding for tvb_eui64_to_str * Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector svn path=/trunk/; revision=37015
2011-05-05Introduce ip6_to_str_buf_len (little cleaner version of inet_ntop6 from ↵Jakub Zawadzki1-0/+1
wsutil/inet_ntop.c) and use it instead of inet_ntop(AF_INET6, ...) - Add MAX_IP6_STR_LEN define. - use MAX_IP6_STR_LEN as a buffer size when ip6_to_str_buf() is used. svn path=/trunk/; revision=37000
2011-02-11Rename vines_to_str() to tvb_vines_to_str() and make it take a pointer a TVBJeff Morriss1-1/+2
and an offset instead of (generally) a pointer into a TVB. Move most of the contents of packet-vines.h into packet-vines.c: the moved content is only needed in that file. svn path=/trunk/; revision=35912
2011-01-21Introduce, and start using, tvb_eth_to_str().Jeff Morriss1-0/+1
Export tvb_*_to_str() and put them in alphabetical order. svn path=/trunk/; revision=35602
2011-01-16Introduce, and start using, tvb_fc_to_str() and tvb_fcwwm_to_str(): theseJeff Morriss1-0/+2
functions act like their non-tvb counterparts except that they take a tvb and and offset instead of a pointer to a byte array. This basically saves the dissectors from having to call tvb_get_ptr()--which in this case eliminates a couple of typos in the length given to tvb_get_ptr(). svn path=/trunk/; revision=35549
2011-01-13Introduce, and start using, tvb_ip_to_str() and tvb_ip6_to_str(). TheseJeff Morriss1-0/+2
do the same as the non-tvb equivalents but take a TVB and an offset instead of a pointer to an array of bytes. Their purpose is to prevent (many) dissectors from doing: ip_to_str(tvb_get_ptr(...)). (About the names and the location: I like the names as they are but the names imply that they should live in tvbuff.c. That would make some sense but I didn't want to pull to_str.h into tvbuff.c...) svn path=/trunk/; revision=35519
2010-05-21Have abs_time_to_str() and abs_time_to_str_secs() take an additionalGuy Harris1-2/+4
argument indicating whether to include the time zone in the string. If we're constructing a display filter, don't include the time zone, otherwise do. Fixes bug 4756. svn path=/trunk/; revision=32913
2010-04-03 From Yaniv Kaul: constify parametersBill Meier1-21/+21
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 From me: Fix a number of instances where the function prototype or the function definition wasn't changed so there was a mismatch thus causing Windows (but not gcc) compilation errors. svn path=/trunk/; revision=32365
2010-04-02Revert SVN #32360 until Windows compilation errors corrected.Bill Meier1-15/+15
svn path=/trunk/; revision=32361
2010-04-02From Yaniv Kaul: constify parametersBill Meier1-15/+15
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 svn path=/trunk/; revision=32360
2010-02-27Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with theGuy Harris1-14/+3
date as YYYY/DDD, where DDD is a 1-origin day of year. Move the formats to a "time_fmt.h" file, included by the headers that use it. Have abs_time_to_str() and abs_time_secs_to_str() take the date format value, rather than a Boolean "show this as UTC" flag, as an argument. Document the ABSOLUTE_TIME_ formats a bit better. Use that format in the CCSDS and VCDU dissectors, rather than having those dissectors do the formatting themselves. svn path=/trunk/; revision=32034
2010-02-23From Jakub Zawadzki:Anders Broman1-3/+3
Optimizations. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303 svn path=/trunk/; revision=31967
2010-01-19Use more unique names for certain enum constants.Bill Meier1-9/+9
(enum constant names are part of the global name space). (Fixes at least one gcc -Wshadow warning). svn path=/trunk/; revision=31572
2009-12-10Add an argument to abs_time_to_str() and abs_time_secs_to_str()Guy Harris1-2/+2
indicating whether the time should be shown as local time or UTC. For now, always pass FALSE, meaning "show as local time". Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str() for times with one-second resolution, and update a comment in various macros in the WSP dissector, while we're at it. svn path=/trunk/; revision=31227
2009-09-06Rename address_to_str() to ep_address_to_str() because:Kovarththanan Rajaratnam1-1/+3
1) This indicates that the string has ephemeral lifetime 2) More consistent with its existing seasonal counterpart, se_address_to_str(). svn path=/trunk/; revision=29747
2009-08-21Sanitize epan includesKovarththanan Rajaratnam1-1/+1
svn path=/trunk/; revision=29502
2009-07-07Introduce se_address_to_str()Anders Broman1-0/+1
svn path=/trunk/; revision=28973
2009-06-25From Nathan Hartwell via bug 2733:Stig Bjørlykke1-0/+1
Added time_secs_to_str_unsigned(). svn path=/trunk/; revision=28840
2009-05-15Introduce decode_bits_in_field() and use it.Anders Broman1-0/+2
clean up some left owers from previous checkin. svn path=/trunk/; revision=28373
2008-06-25Constify a bunch of stuff, to squelch -Wwrite-strings warnings. Guy Harris1-1/+1
epan/dissectors/packet-ncp2222.inc is a bit hard to fix, so we're not ready to enable that warning by default yet. Throw in some casts to handle GLib routines that take arbitrary non-const pointers (they can later return the pointers, and some callers might want to modify or free up those pointers in cases where they're known to be writable or allocated). Use ep_tvb_memdup() rather than a combination of ep_alloc() and tvb_memcpy(). Clean up some indentation. svn path=/trunk/; revision=25601
2007-08-25replace oid_to_str_buf() and oid_to_str()Luis Ontanon1-3/+0
fix a potential buffer overflow due to a very liberal estimate by oid_repr_len() svn path=/trunk/; revision=22659
2007-01-29Fix potential buffer overruns in address_to_str_buf() found by Andrej Gerald Combs1-1/+3
Mikus. Add a buf_len parameter to ip_to_str_buf(), and make sure it's enforced. Copy the release notes over from the 0.99.5 trunk and add a note about the ISUP dissector (which is affected by the overrun). svn path=/trunk/; revision=20607
2006-12-05From Douglas Pratley with trivial changes and documentation changes Stephen Fisher1-0/+2
by myself: Corrected patch; epan/column.c and epan/column_utils.c were not included. This one has now been properly tested against a clean checkout of today's code. - New menu option available under view\time display format - New sub-option (e) to -t switch for both wireshark and tshark - Extended recent settings code to handle new value - Did NOT add new explicit epoch time column svn path=/trunk/; revision=20040
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-03-10new FT_GUID handling - big/little endian supportedTomas Kukosa1-2/+2
svn path=/trunk/; revision=17566
2005-12-01Add TIPC address as address type and use it in TIPC.Anders Broman1-0/+1
svn path=/trunk/; revision=16641
2005-08-28Export "bytestring_to_str()", and use it when adding the link-layerGuy Harris1-0/+1
address for the ND_OPT_TARGET_LINKADDR ICMPv6 packet type. svn path=/trunk/; revision=15591