Commit Graph

145 Commits

Author SHA1 Message Date
Michael Mann 4a5ca5c76e bytes_to_ep_str -> bytes_to_str
Change-Id: Ifcda8328dedec0ef4104c3a124d6246f99493750
Reviewed-on: https://code.wireshark.org/review/6389
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:43:51 +00:00
Michael Mann 98d3b1494b Replace bytes_to_ep_str_punct with wmem equivalent.
Change-Id: I8aa7d7374db94685fd875cbf358c3bfbc83f3255
Reviewed-on: https://code.wireshark.org/review/6370
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:12:35 +00:00
Michael Mann 493f03b420 Remove bytestring_to_ep_str
Use wmem equivalent bytestring_to_str

Change-Id: I1ec7509e3adb36ab0f65317459653cb3b4b11af8
Reviewed-on: https://code.wireshark.org/review/6368
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:01:15 +00:00
Michael Mann 47d670d3d7 Add tvb_address_to_str.
This is intended to handle ALL address types retrieved from a tvbuff.

One of the (good) side effects of this function is that it can replace a lot of the "hidden" ep_alloc calls used to allocate memory for the address string.

A few existing "popular" helper tvb_ functions were turned into pure macros calling tvb_address_to_str.  Some of the "less used" helper tvb_ functions were just directly replaced with tvb_address_to_str.

Change-Id: I361d991c4ad90142173e63eae02a94d68af3ec43
Reviewed-on: https://code.wireshark.org/review/6333
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 04:25:07 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
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: Anders Broman <a.broman58@gmail.com>
2015-01-06 07:38:18 +00:00
Hadriel Kaplan fac8356610 Make all Lua code use wmem not emem
Changed all remaining code in wslua that was using emem, to use wmem or
simpler methods.

Bug: 9927
Change-Id: I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55
Reviewed-on: https://code.wireshark.org/review/6109
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04 21:02:38 +00:00
Michael Mann 71c02b20eb Create FT_FCWWN field type.
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type.

Change-Id: I4ca77870499fd8239584a70874998b5d194a7167
Reviewed-on: https://code.wireshark.org/review/6036
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 20:05:29 +00:00
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00
Michael Mann e03ffe2583 Replace fc_to_str with address_to_str or tvb_fc_to_str.
Change-Id: I69bf25f5abb9d6ad325f922fab73b6f0cf8ca2ea
Reviewed-on: https://code.wireshark.org/review/6035
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-24 18:59:14 +00:00
Michael Mann f002332d88 Replace ether_to_str with either address_to_str or tvb_ether_to_str.
Change-Id: I8cce9fddbfe950e27e96ea8a5a6d2e0921ff4260
Reviewed-on: https://code.wireshark.org/review/5933
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21 15:13:30 +00:00
Michael Mann cdaa669829 Replace ax25_to_str and get_ax25_name with address_to_str.
Change-Id: I74ddb6fc629ef32b217dede7a3ba652cbbf5ab12
Reviewed-on: https://code.wireshark.org/review/5932
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21 15:12:58 +00:00
Michael Mann c347eb965b Eliminate proto_tree_add_text from packet-ipx.c
Change-Id: Ie084a33be94d91eec7f5f70ef31fcb0835ad266c
Reviewed-on: https://code.wireshark.org/review/4829
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-19 03:01:54 +00:00
Daniel Mack ed0b19b94b Make boolean bitmask type 64-bit wide
There are protocols out there that have 64-bit wide bit mask fields, so
make the internal representation and bitfield decoders 64-bit aware.

For this, the ws_ctz() fallback and bits_count_ones() have to be tweaked
slightly.

Change-Id: I19237b954a69c9e6c55864f281993c1e8731a233
Reviewed-on: https://code.wireshark.org/review/4158
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: Michael Mann <mmann78@netscape.net>
2014-10-12 14:15:12 +00:00
Peter Wu f2b4daf400 Add printf-format annotations, fix garbage
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-07-06 23:00:40 +00:00
Evan Huus e0aabd97d8 Convert more time_to_str functions to wmem
Change-Id: Ibaae0e79935dc62f12f713f2df5b57d0f3f799b9
Reviewed-on: https://code.wireshark.org/review/2254
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 19:10:59 +00:00
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +00:00
Guy Harris 45da41d6fe Fix declaration to match definition.
Change-Id: I9fcfddb34b2a22c3e2cf8f8fc9671eed2e8aef43
Reviewed-on: https://code.wireshark.org/review/1649
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 04:17:01 +00:00
Guy Harris 09bf1702a6 Get rid of some uses of tvb_get_ptr().
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-05-15 03:16:15 +00:00
Guy Harris 80011ec03c Don't se_ allocate strings when mapping addresses to column strings.
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-04-19 14:20:06 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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-03-04 14:27:33 +00:00
Gilbert Ramirez 4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.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-02-03 09:26:10 +00:00
Guy Harris c6c1887a0b Have ip6_to_str() and tvb_ip6_to_str() return const pointers, as the
ip_to_str equivalents do.

Don't cast away constness, and don't make it necessary to do so.

svn path=/trunk/; revision=54767
2014-01-14 05:39:57 +00:00
Evan Huus 6be37815a1 Add bytestring_to_str() which takes a wmem scope and is otherwise identical to
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-19 20:53:44 +00:00
Evan Huus 2ae8edccea Rename more to_str functions to have ep_ in the name if they return ephemeral
buffers. Remove two unused functions.

svn path=/trunk/; revision=54250
2013-12-19 16:28:39 +00:00
Evan Huus a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
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-12-19 15:49:09 +00:00
Evan Huus d97c9e2ff4 Implement address_to_str which is like ep_address_to_str and se_address_to_str
except it takes a wmem scope instead. Add the two emem equivalents to checkAPI
as (weakly) deprecated.

svn path=/trunk/; revision=53528
2013-11-23 22:17:27 +00:00
Evan Huus df1aec4a6b Remove old (2009) and no-longer-necessary compatibility macro.
svn path=/trunk/; revision=53527
2013-11-23 22:03:48 +00:00
Jakub Zawadzki 7b64bcf0b8 Move prototype of bytes_to_str, bytes_to_str_punct to correct header.
svn path=/trunk/; revision=53214
2013-11-10 09:44:02 +00:00
Gerald Combs 1d27c70838 Add an item tracer to the TCP stream graph. Enable packet selection.
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-08-30 21:15:24 +00:00
Jeff Morriss a441793cba Move a couple of time-related modules into wsutil.
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-25 22:02:20 +00:00
Pascal Quantin 24623bdff3 More PDU export work:
- 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-06-17 21:54:21 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
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-12-26 05:57:06 +00:00
Guy Harris 835111692f From Richard Stearn: support for AX.25, including support for
LINKTYPE_AX25.

svn path=/trunk/; revision=44211
2012-08-02 16:54:43 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Gerald Combs 8b3024e57c Make bit_offset in _tvb_get_bits64 and related functions unsigned. This
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
2012-04-04 21:54:22 +00:00
Alexis La Goutte 7d317e553b Add FT_EUI64 Field Type
* 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-08 10:23:53 +00:00
Jakub Zawadzki 453d0a8568 Introduce ip6_to_str_buf_len (little cleaner version of inet_ntop6 from 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-05-05 20:48:21 +00:00
Jeff Morriss 0f59bc7c45 Rename vines_to_str() to tvb_vines_to_str() and make it take a pointer a TVB
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-02-11 03:13:24 +00:00
Jeff Morriss 6e0fcb7ab5 Introduce, and start using, tvb_eth_to_str().
Export tvb_*_to_str() and put them in alphabetical order.

svn path=/trunk/; revision=35602
2011-01-21 02:48:55 +00:00
Jeff Morriss 77b3392e72 Introduce, and start using, tvb_fc_to_str() and tvb_fcwwm_to_str(): these
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-16 04:33:42 +00:00
Jeff Morriss a167206685 Introduce, and start using, tvb_ip_to_str() and tvb_ip6_to_str(). These
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
2011-01-13 15:53:30 +00:00
Guy Harris 927b7da346 Have abs_time_to_str() and abs_time_to_str_secs() take an additional
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-05-21 06:33:25 +00:00
Bill Meier 6812b68eb1 From Yaniv Kaul: constify parameters
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-03 18:18:50 +00:00
Bill Meier d32b4c0758 Revert SVN #32360 until Windows compilation errors corrected.
svn path=/trunk/; revision=32361
2010-04-02 15:18:03 +00:00
Bill Meier 049f9eac85 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

svn path=/trunk/; revision=32360
2010-04-02 14:37:49 +00:00
Guy Harris 500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
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-27 19:01:27 +00:00
Anders Broman 4e66c899d1 From Jakub Zawadzki:
Optimizations.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303

svn path=/trunk/; revision=31967
2010-02-23 19:28:38 +00:00
Bill Meier e0064797fb Use more unique names for certain enum constants.
(enum constant names are part of the global name space).
(Fixes at least one gcc -Wshadow warning).

svn path=/trunk/; revision=31572
2010-01-19 19:37:03 +00:00
Guy Harris 4fde145bd2 Add an argument to abs_time_to_str() and abs_time_secs_to_str()
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-12-10 22:19:29 +00:00
Kovarththanan Rajaratnam 8c48c6835f Rename address_to_str() to ep_address_to_str() because:
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-09-06 14:25:47 +00:00
Kovarththanan Rajaratnam 2046b144d9 Sanitize epan includes
svn path=/trunk/; revision=29502
2009-08-21 20:51:13 +00:00
Anders Broman 23b068e307 Introduce se_address_to_str()
svn path=/trunk/; revision=28973
2009-07-07 09:42:09 +00:00
Stig Bjørlykke 7221f30ab3 From Nathan Hartwell via bug 2733:
Added time_secs_to_str_unsigned().

svn path=/trunk/; revision=28840
2009-06-25 02:07:17 +00:00
Anders Broman 1464f7ca84 Introduce decode_bits_in_field() and use it.
clean up some left owers from previous checkin.

svn path=/trunk/; revision=28373
2009-05-15 18:38:13 +00:00
Guy Harris 83fc9d5e09 Constify a bunch of stuff, to squelch -Wwrite-strings warnings.
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
2008-06-25 09:12:35 +00:00
Luis Ontanon bcd55f4c8e replace oid_to_str_buf() and oid_to_str()
fix a potential buffer overflow due to a very liberal estimate by oid_repr_len()


svn path=/trunk/; revision=22659
2007-08-25 17:29:55 +00:00
Gerald Combs 063621f11b Fix potential buffer overruns in address_to_str_buf() found by Andrej
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
2007-01-29 20:25:26 +00:00
Stephen Fisher 75acf34518 From Douglas Pratley with trivial changes and documentation changes
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-12-05 03:19:51 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Tomas Kukosa 923855bb20 new FT_GUID handling - big/little endian supported
svn path=/trunk/; revision=17566
2006-03-10 11:58:22 +00:00
Anders Broman f07dd2bfcf Add TIPC address as address type and use it in TIPC.
svn path=/trunk/; revision=16641
2005-12-01 20:02:45 +00:00
Guy Harris 374c3d0b75 Export "bytestring_to_str()", and use it when adding the link-layer
address for the ND_OPT_TARGET_LINKADDR ICMPv6 packet type.

svn path=/trunk/; revision=15591
2005-08-28 06:44:06 +00:00
Ulf Lamping 723c80ea90 timestamp display precision:
- automatic adjustment depending on file format
- manual adjustment through menu items

save the setting in the recent file

svn path=/trunk/; revision=15534
2005-08-25 21:29:54 +00:00
Ronnie Sahlberg a34e7e3d03 removal of even more sprintf
svn path=/trunk/; revision=15457
2005-08-20 02:33:33 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Tomas Kukosa bab34b522b new field type FT_GUID
svn path=/trunk/; revision=14845
2005-07-04 13:04:53 +00:00
Guy Harris 73cad260c5 "oid_to_str()" and "oid_to_str_buf()" don't modify what the "oid"
argument points to, so make it a "const" pointer.

svn path=/trunk/; revision=14311
2005-05-05 09:40:24 +00:00
Tomas Kukosa 3be38ac077 New oid_to_str() and oid_to_str_buf() functions
svn path=/trunk/; revision=14216
2005-04-28 09:51:55 +00:00
Ronnie Sahlberg 83f14e4614 change time_secs_to_str() and time_msecs_to_str() to take a signed integer as parameter so we can handle negtive times
svn path=/trunk/; revision=14055
2005-04-12 19:59:08 +00:00
Guy Harris 87c98feed8 "address_to_str()" and "address_to_str_buf()" don't modify the "address"
structure pointed to them by reference, so make the argument a "const"
pointer.

svn path=/trunk/; revision=12911
2005-01-01 12:29:26 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
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.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Jörg Mayer ebc0b265bd to_str.c declares this: gchar* ip6_to_str ..., make to_str.h do the same
(char -> gchar)

svn path=/trunk/; revision=9629
2004-01-10 12:50:19 +00:00
Guy Harris 8061eba526 Add "ip6_to_str_buf()", by analogy to "ip_to_str_buf()".
svn path=/trunk/; revision=9216
2003-12-09 05:06:22 +00:00
Guy Harris a93463727e Get rid of the private "my_decode_bitfield_value()" a number of
dissectors had.  Instead, rename it "other_decode_bitfield_value()", put
it in "epan/to_str.c", and make "decode_bitfield_value()" use it.

svn path=/trunk/; revision=9213
2003-12-08 23:40:13 +00:00
Guy Harris d9c401c74c Create an "address_to_str_buf()" routine, called by "address_to_str()",
which fills in a caller-supplied buffer.

Create "_buf()" versions of various "to_str" routines for various
address types, and create a routine to map SNA FIDs to strings, and use
them to finish up "address_to_str_buf()".

Get rid of the declaration of "sna_fid_type_4_addr_to_str()" in
"packet-sna.h", as that routine has been swallowed up in
"sna_fid_to_str()".

svn path=/trunk/; revision=8260
2003-08-26 01:00:30 +00:00
Ronnie Sahlberg 521db7b61f Add a new function address_to_str to to_str.c
Implement conersion from address to string for IPv4 and IPv6
and update the conversation tables to use the new interface.

svn path=/trunk/; revision=8234
2003-08-24 02:50:32 +00:00
Guy Harris 29b99f4e69 FC addresses are no longer extracted into guint32s, so "fc32_to_str()"
is no longer needed.

svn path=/trunk/; revision=8226
2003-08-24 01:06:21 +00:00
Ronnie Sahlberg 5cf0634041 Add FibreChannel to the types of protocols we can show a conversation list for
svn path=/trunk/; revision=8223
2003-08-23 13:35:06 +00:00
Ronnie Sahlberg 9e18043830 Update to FC to store the source and destination id in a guint
to make it easier to add matching and response times later.

svn path=/trunk/; revision=7916
2003-06-23 09:15:08 +00:00
Guy Harris 6c99ee4db0 Make the argument to "abs_time_secs_to_str()" a "time_t" - it's in ANSI
C, and it's the right thing to pass to "localtime()".

svn path=/trunk/; revision=7125
2003-02-12 00:44:04 +00:00
Guy Harris 1ad3b70b4b Add a "abs_time_secs_to_str()" routine that takes a UNIX time-since-the-
epoch-in-seconds value and converts it to a string.

Use that routine in the RADIUS dissector, rather than using "ctime()"
and "tzname[]" - "tzname[]" strings might contain non-ASCII characters,
which currently give the GTK+ 1.3[.x] used on Windows, and also, I
think, GTK+ 2.x, heartburn, as they expect UTF-8, not, for example, ISO
8859/1.

Fix the string length in "abs_time_to_str()".

svn path=/trunk/; revision=7124
2003-02-11 19:42:38 +00:00
Guy Harris bc06f2e440 Work around annoying Apple C compiler/linker bug.
"ether_to_str_punct()" no longer deals only with Ethernet-style
addresses, as it now takes a length argument, rename it
"bytestring_to_str()" - and make it static, as it's not used outside
"to_str.c".

Get rid of unused "fc_to_str_buf()" routine.

svn path=/trunk/; revision=6770
2002-12-09 21:34:58 +00:00
Guy Harris ad323ca96f Clean up a bit, and put "extern" back.
svn path=/trunk/; revision=6768
2002-12-08 22:53:00 +00:00
Gerald Combs b60b1414c3 From Dinesh Dutt: Add Fibre Channel support, including FCIP, Basic FC
header, Extended Link Service, Interswitch Link Service, FCP, and IPFC.

svn path=/trunk/; revision=6757
2002-12-08 02:32:36 +00:00
Guy Harris 0abda39c90 Make "ip6_to_str()" take a const pointer as an argument.
svn path=/trunk/; revision=6687
2002-11-28 03:54:50 +00:00
Jörg Mayer 48be4e530d Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6116
2002-08-28 20:41:00 +00:00
Jörg Mayer 3105ee542f Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c
and inet_ntop.c for now (can't estimate the consequences).

svn path=/trunk/; revision=5928
2002-08-02 21:29:45 +00:00
Guy Harris eb70c97a9b Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly.  Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.

Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.

Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.

Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.

Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.

svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
Guy Harris 1d42c94b05 Make the resolution for time values be nanoseconds rather than
microseconds.

Fix some "signed vs. unsigned" comparison warnings.

svn path=/trunk/; revision=3934
2001-09-14 07:10:13 +00:00
Guy Harris d451acb66c Add a "time_secs_to_str_buf()" routine, which takes seconds and
fractions-of-a-second (the units of which are either milliseconds or
microseconds, specified by a Boolean argument), and formats it into a
"DD days, HH hours, MM minutes, SS seconds" using a buffer supplied to
it.  Have "time_secs_to_str()" and "time_msecs_to_str()" both use it.
Also, have it correctly handle the case of SS being > 0 but < 1 (which
"time_msecs_to_str()" didn't do).

Rename "rel_time_to_str()" to "rel_time_to_secs_str()", and add a
"rel_time_to_str()" routine that takes a "struct timeval" and hands its
seconds and microseconds values to "time_secs_to_str_buf()".  Use
"rel_time_to_secs_str()" to format FT_RELATIVE_TIME values for now; we
might want to use "rel_time_to_str()" for them, though, or make it an
option (either a user option, or a per-field option, using the field
that also holds BASE_ values).

svn path=/trunk/; revision=3806
2001-08-01 08:27:00 +00:00
Guy Harris 82a553e9c9 Add a "time_msecs_to_str()" routine, to turn a time interval, expressed
as a 32-bit number of milliseconds, to a descriptive string.

Use that in the MS Browser dissector.

svn path=/trunk/; revision=3708
2001-07-13 00:27:51 +00:00
Ed Warnicke 1d4e847837 Moved vines_addr_to_str() from packet-vines.{h,c} to epan/to_str.{c,h}.
svn path=/trunk/; revision=3229
2001-04-01 06:32:10 +00:00
Ed Warnicke c17e3b00c6 Moved various to_str files from packet.{c,h} to a separate
to_str.{c,h}.  Resolved strange situation where ipx_addr_to_str was
declared in packet.h but defined in packet-ipx.c by moving
ipx_addr_to_str, ipxnet_to_str_punct, and ipxnet_to_str from packet-ipx.{c,h}   to to_str.{c,h}

svn path=/trunk/; revision=3219
2001-04-01 02:47:56 +00:00