Commit graph

124 commits

Author SHA1 Message Date
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
adde80ad43 From Jakub Zawadzki: split off the address-to-string functions, except
for ip_to_str_buf(), into address_to_str.c.

Fix up the SVN attributes for time_fmt.h while we're at it.

svn path=/trunk/; revision=32038
2010-02-27 21:41:12 +00:00
Guy Harris
45bed99e2b Squelch some compiler warnings.
svn path=/trunk/; revision=32036
2010-02-27 20:12:47 +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
35574147d7 From Jakub Zawadzki:
Don't sigsegv on negative bd_len in bytes_to_str*

svn path=/trunk/; revision=31986
2010-02-24 12:59:09 +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
9d663d7081 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31720
2010-01-28 18:45:46 +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
818b8c3878 Protect against localtime() failing.
svn path=/trunk/; revision=31238
2009-12-11 08:08:05 +00:00
Guy Harris
38316e0483 The pointer is "tmp", not "tm".
svn path=/trunk/; revision=31237
2009-12-11 07:17:09 +00:00
Guy Harris
229b262e15 Squelch warnings.
svn path=/trunk/; revision=31236
2009-12-11 07:14:52 +00:00
Guy Harris
488253bfe7 Add the time zone abbreviation to the result of abs_time_to_str() and
abs_time_secs_to_str().

svn path=/trunk/; revision=31234
2009-12-11 03:39:17 +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
Guy Harris
4ac5594f7b Note that there are similar functions to the "to_hexstr" functions
in strutil.c.

svn path=/trunk/; revision=31212
2009-12-09 01:31:41 +00:00
Stig Bjørlykke
d71b1088f7 From Jakub Zawadzki:
Fix win64 build.

svn path=/trunk/; revision=31204
2009-12-08 10:17:37 +00:00
Anders Broman
e59f952b98 From Jakub Zawadzki:
Replace some g_snprintf() with 'probably' faster version.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303

svn path=/trunk/; revision=31201
2009-12-08 07:45:06 +00:00
Anders Broman
88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +00:00
Kovarththanan Rajaratnam
d6122ad422 Reorder file to group related functionality
svn path=/trunk/; revision=29753
2009-09-06 15:06:41 +00:00
Kovarththanan Rajaratnam
f641693bf4 Change se_address_to_str() to call address_to_str_buf() directly
svn path=/trunk/; revision=29748
2009-09-06 14:39:53 +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
Stig Bjørlykke
f900d9c3a5 From Jakub Zawadzki via bug 3701:
Fix regressions in r29130 and r29133
In r29130 formating for DSECS was changed. (old: %01d now: %02d)
In r29133 adding sign was removed (old: buf[0] = '-' now: buf[0] = '\0')

svn path=/trunk/; revision=29146
2009-07-20 12:40:55 +00:00
Gerald Combs
25e7cac69d Fix an ep buffer overrun introduced in r29130.
svn path=/trunk/; revision=29133
2009-07-17 15:59:24 +00:00
Anders Broman
3278582767 From Kovarththanan Rajaratnam:
Optimize column fill path.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3701

svn path=/trunk/; revision=29130
2009-07-17 08:24:06 +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
1ec579f62b Unsigned does not have msign.
svn path=/trunk/; revision=28842
2009-06-25 02:13:35 +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
Gerald Combs
d6d9e7afdc Fix the last commit.
svn path=/trunk/; revision=28001
2009-04-08 17:55:35 +00:00
Gerald Combs
c2ae798ae2 More size_t fixes.
svn path=/trunk/; revision=28000
2009-04-08 17:31:12 +00:00
Gerald Combs
ffe205dd8b Check in a modified version of Alexey Neyman's patch from bug 2777. This should
also fix bug 2899. Make sure we only print a minus sign once and fixup a
comment.

svn path=/trunk/; revision=26302
2008-09-30 02:56:11 +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
Ulf Lamping
013332de7f fix a bug found while fuzz testing the opcua dissector:
MSVC 2005 crashes, if localtime is called with very large numbers (in this case 218939827321) - probably due to changes that time_t is now 64bits long as default

limit the number given to localtime to a reasonable value

while this isn't a nice fix, I don't see a better way to fix it :-(

svn path=/trunk/; revision=21759
2007-05-14 13:47:03 +00:00
Guy Harris
08ab8d8734 mtp3_addr_to_str_buf() and mtp3_pc_hash() expect to be passed a pointer
to a mtp3_addr_pc_t; declare them as such, and pass the argument as
such.

svn path=/trunk/; revision=21595
2007-04-26 07:57:44 +00:00
Guy Harris
8a998bf38a For address types where the address is a bunch of bytes, convert the
address data pointer from a void * to a guint8 *.

For AT_STRINGZ, convert it to a char *.

Fix indentation.

svn path=/trunk/; revision=21584
2007-04-26 03:32:38 +00:00
Ulf Lamping
3e32597719 fix some more warnings
svn path=/trunk/; revision=21104
2007-03-22 00:40:04 +00:00
Gerald Combs
9f5386d408 From Andrej Mikus:
IMO, the function should return an error string instead of cowardly
  bailing out with an empty string.

  inet_ntop does the latter by default, so it does not need any additional
  check, just passing buf_len instead of INET6_ADDRSTRLEN.
  
  At the other side I like the check you made into ip_to_str_buf.

  My proposal would be to combine the patches and use MAX_IP_STR_LEN,
  and approach below for both IPv4 and IPv6 in address_to_str_buf.

Have the error string return a more descriptive clue.

svn path=/trunk/; revision=20658
2007-01-31 23:26:29 +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
Jörg Mayer
6f7089fe26 Commit my USB changes (change address handling)
svn path=/trunk/; revision=20346
2007-01-08 14:32:10 +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
24ef4fcef0 create a new address type AT_USB and start populating the packet list
with nice data




svn path=/trunk/; revision=19524
2006-10-14 05:02:40 +00:00
Ronnie Sahlberg
89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris
16614b4ed1 Squelch a compiler warning.
svn path=/trunk/; revision=17759
2006-03-29 21:54:22 +00:00
Jaap Keuter
b21337192c From Olivier Jacques:
- to_str.c: add support of "AT_NONE" address type in address_to_str_buf (avoid the assert failed later on
when messages have address type of AT_NONE - which can be the case for an MTP2 capture with FISU messages)
- packet-isup.c: changed source and destination addresses from (net_src and net_dst) to (src and dst) so 
that addresses taken into account in the statistics are the SS7 point codes

svn path=/trunk/; revision=17720
2006-03-24 14:26:01 +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
Tim Potter
0afb8cd493 Remove a linebreak to emphasise the guid structure (doesn't change
the byte ordering).

svn path=/trunk/; revision=17561
2006-03-10 03:03:06 +00:00
Anders Broman
e9b933473e From Mike Duigou:
- Fixes an off by one error which had the potential to write a 
terminating '\0' one byte past the end of the URI address being printed.

svn path=/trunk/; revision=17144
2006-02-03 06:31:01 +00:00