Commit Graph

242 Commits

Author SHA1 Message Date
Anders Broman 1567e207a9 Try to speed up decode_bits_in_field().
svn path=/trunk/; revision=46487
2012-12-09 23:12:59 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Guy Harris dfe0389590 Move the AX.25 address routines to address_to_str.c, where they belong;
hopefully this will fix some of the build errors.

svn path=/trunk/; revision=44219
2012-08-02 18:51:40 +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
Chris Maynard 557ab87a9b Trivial typo: of -> or
svn path=/trunk/; revision=42458
2012-05-07 04:15:10 +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
Guy Harris 0bd7a24d4b Put back the checks for null arguments, but report a dissector bug if
we're given null pointers.

Put in comments clarifying that some routines intentionally do *not*
null terminate the strings they produce.

svn path=/trunk/; revision=40194
2011-12-14 02:46:16 +00:00
Guy Harris dfe020b5f9 Back the previous change out; I'll be checking in a change to throw a
dissector bug exception in cases where a null pointer was passed, as
those really *are* dissector bugs (and I have a fix for the bug in
question in the HP Teaming heartbeat dissector, which I'll be checking
in later).

svn path=/trunk/; revision=40193
2011-12-14 02:03:05 +00:00
Chris Maynard 47116e864c Protect against NULL pointers as input. Based on the stacktrace provided, this should avoid crashes reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6634
svn path=/trunk/; revision=40176
2011-12-13 16:50:34 +00:00
Bill Meier 4f420ef6cd Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings
svn path=/trunk/; revision=37600
2011-06-07 22:28:55 +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
Chris Maynard ee36a5cfbe Use g_strlcat instead of strcat: Coverity 632.
svn path=/trunk/; revision=36598
2011-04-12 18:16:55 +00:00
Jaap Keuter 1be49d98a5 From Matthew Parris:
Display "Day of Year" for January 1 as 1, not 0.

svn path=/trunk/; revision=35949
2011-02-15 07:14:22 +00:00
Stig Bjørlykke 3d11d9c9d9 Print "0 seconds" when time_val==0 in functions converting seconds to string.
svn path=/trunk/; revision=35640
2011-01-24 19:33:36 +00:00
Bill Meier 2276b10ddf Add a comment about not needing to g_free() the value returned from g_locale_to_utf8().
svn path=/trunk/; revision=35240
2010-12-21 21:01:01 +00:00
Bill Meier 7d0c23a125 Fix a GCC error.
svn path=/trunk/; revision=35087
2010-12-01 02:18:01 +00:00
Bill Meier bd793cd800 On Windows: convert _tzname[] strings from the system charset to UTF8 before use.
In the Windows C Runtime the strings in the global array _tzname[]
   are encoded using the "system default ansi code page".
   They must be converted to UTF8 before use by Wireshark/GTK.
   (See comment in the code for details).

   Fixes Bug #5421 (I hope).
   https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5421

Also: Fix bug: when the timezone name is not available from the system
      ?ST was used when ?DT should have been used (and vice-versa).

svn path=/trunk/; revision=35086
2010-12-01 01:31:49 +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 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
Gerald Combs 4b15bf76a7 Fix an off-by-one error. Fixes bug 698, possibly others.
svn path=/trunk/; revision=17048
2006-01-17 18:50:02 +00:00
Tomas Kukosa 7ab60e33cc oid_to_str_buf() keep enough speace before appending next part of string (Bug 669)
svn path=/trunk/; revision=17017
2006-01-12 09:29:41 +00:00
Jörg Mayer ba31392772 warning: no newline at end of file
svn path=/trunk/; revision=16854
2005-12-18 23:23:21 +00:00
Tomas Kukosa dcae7d303f new field type FT_OID for OBJECT IDENTIFIERs
svn path=/trunk/; revision=16652
2005-12-02 13:16:58 +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
Gerald Combs be65a36fcf If bytes_to_str() is passed a zero length value, return an empty string
instead of asserting.  Fixes bug 560.

Fix up whitespace.

svn path=/trunk/; revision=16350
2005-10-28 15:08:14 +00:00
Anders Broman 3a6ea1fc9b From Mike Duigou
Safer handling for building address string for AT_STRINGZ and AT_URI.

svn path=/trunk/; revision=16321
2005-10-26 19:08:37 +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
Ronnie Sahlberg aff31978c1 remove sprintf from mtp3
svn path=/trunk/; revision=15451
2005-08-20 01:24:23 +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
Jörg Mayer 30a8557868 More 'char*' -> 'const char*' changes to fix warnings.
svn path=/trunk/; revision=15015
2005-07-23 11:41:25 +00:00
Ronnie Sahlberg 070351d090 convert all other nasty "rotating static array" from to_str.c and make them use the new emem api.
svn path=/trunk/; revision=14987
2005-07-22 08:27:20 +00:00
Ronnie Sahlberg c841beb71b EMEM : a simple and FAST api to allocate memory that will be automatically freed() when the next packet is dissected.
This offesr memory allocation with a packet  scope making memory leaks less likely and memory management faster.


Add initialization calls for both tethereal and ethereal.

Convert the ip_to_str() function to use this and avoid doing the silly rotating buffers thing it previously did.


We also need an equivalent set of functions for allocation with capture file scope (free when next capture is loaded) but i dont know where to put the free_all call.



svn path=/trunk/; revision=14984
2005-07-22 07:46:58 +00:00
Tomas Kukosa b579d77b9a GUID lowercase form seems to be preferred
svn path=/trunk/; revision=14855
2005-07-05 18:55:17 +00:00
Tomas Kukosa bab34b522b new field type FT_GUID
svn path=/trunk/; revision=14845
2005-07-04 13:04:53 +00:00
Gerald Combs 6a4b3f9cd7 Fix an off-by-four error, which should take care of bugs 254 - 258. Print
OID values as unsigned ints instead of signed.

svn path=/trunk/; revision=14729
2005-06-22 15:37:46 +00:00
Anders Broman 7ec6ab1d78 From Mike Duigou:
In order to get filtering of conversations and
> endpoints to work from the endpoints and conversations windows I found 
> it necessary to add a new AT_URI address type and a SAT_JXTA. This also 
> necessitated a change to to_str.c to avoid a buffer overflow problem. 
> Please review these changes carefully.
> 
> Also includes some changes to the jxta dissector to fix filtering on
> generated fields and some changes to the types used for ints/unsigned ints.
> 
> Fixes a bug with the processing of messages containing namespaces.

svn path=/trunk/; revision=14715
2005-06-20 20:14:57 +00:00
Anders Broman 45fb18a2d6 From Mike Duigou:
a patch to to_str.c which adds support for printing 
AT_STRINGZ address type. Amazing that this wasn't there!

svn path=/trunk/; revision=14557
2005-06-06 15:17:41 +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
Gerald Combs af3435f669 In time_secs_to_str_buf(), handle the case where a large time value makes
things go wonky.

svn path=/trunk/; revision=14097
2005-04-15 21:38:42 +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
Jörg Mayer c49b92ea30 Yniv Kaul: Small performance optimization
It change a while()->do, to do->while() and removes a variable (and an
  assignment to it).

svn path=/trunk/; revision=13270
2005-02-03 23:18:23 +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 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +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
Guy Harris e656facb26 As long as any text has been put into a time interval string, the next
clause we add will have to have ", " separating it from the text before
it.

svn path=/trunk/; revision=11160
2004-06-16 23:09:43 +00:00
Guy Harris c6aeb05249 From Michael Lum:
ANSI and GSM MAP stats enhancements and cleanups;

	enhanced parameter dissection related to SS for GSM A-interface
	and MAP;

	minor GSM SMS fix;

	GSM SS enhancements for parameter dissection;

	MTP3 statistics tap.

svn path=/trunk/; revision=10655
2004-04-21 05:53:59 +00:00
Guy Harris 30b2831847 Add support for DLT_APPLE_IP_OVER_IEEE_1394.
svn path=/trunk/; revision=10446
2004-03-23 01:02:41 +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 d06dc0727a From Michael Lum: support an AT_SS7PC address type for SS7 point codes,
and set the direction in pinfo for SS7 packets based on source and
destination addresses.

svn path=/trunk/; revision=9209
2003-12-08 21:36:53 +00:00
Ronnie Sahlberg 8acd679327 updates to ip_to_str[_buf]() to make them faster.
This functin was in a recent profiling run the fifth most expensive function.
It consumed ~3.5% of the total cpu in that run.

Using a static table this function is now just over twice as fast as previously.

My testrun calling it 10.000.000 times in a loop changed the execution time from ~17.3s ro ~8.2s

If this test was representative for the speedup and if ~3.5 in the profile run
was representative for normal cases this should make ethereal ~1.8% faster.
Woohoo.
(low hanging fruit)

svn path=/trunk/; revision=8992
2003-11-17 22:56:45 +00:00
Guy Harris 96886bd8a0 Get rid of an out-of-date comment.
svn path=/trunk/; revision=8643
2003-10-07 21:15:00 +00:00
Guy Harris 14854b769e Include "osi-utils.h" to define "print_nsap_net_buf()".
svn path=/trunk/; revision=8261
2003-08-26 01:28:28 +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
Guy Harris 0558b4406d Put in some comments about possible future work on "address_to_str()".
Put in some additional "case AT_" statements to

	1) squelch compiler warnings;

	2) add AT_ARCNET (cheap and easy);

	3) add placeholders for some other address types.

svn path=/trunk/; revision=8243
2003-08-24 20:30:46 +00:00
Ronnie Sahlberg 38e52de283 Add endpoint talker support for IPX
svn path=/trunk/; revision=8240
2003-08-24 05:38:23 +00:00
Ronnie Sahlberg bcfc2719b9 Update address_to_str to handle FC and ETH addresses as well.
Update the fc and eth and tr  endpoint talker list to use the new api

svn path=/trunk/; revision=8235
2003-08-24 03:00:11 +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 cb92d3284b Update the UDP and the TCP conversation list tool so that it can handle IPv6 as well.
Make no distinction between UDP/TCP over IPv4 and UDP/TCP over IPv6
and present them in the same list.

svn path=/trunk/; revision=8224
2003-08-23 13:56:40 +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
Guy Harris 8fdb55e9e6 Make the definition of "fc32_to_str()" match its prototype.
Make it have the usual collection of 3 static buffers, just in case
somebody decides to call it more than once in the same
printf-like-routine call.

svn path=/trunk/; revision=7940
2003-06-26 08:47:31 +00:00
Ronnie Sahlberg 728d0bab44 Updates to the fibre channel dissector
removed two hf fields that are now redundant since F_CTL is decoded

placed most interesting header fields in a struct

added request response matching and measurement of delta time between the first and the last frame of an exchange.

todo:
1, finish restructure of decoding of fc header so that
it will populate the tree as it reads more data fields from the tvb
so that we can get useful info in the tree even for short frames.
2, add TAP to fc and pass the header struct and the time delta struct to
tap listeners
3, add ServiceResponseTime tap listener for FC

svn path=/trunk/; revision=7923
2003-06-24 15:37:31 +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 f8fec006d1 From Brian Ginsbach: symbolic names for Fibre Channel Network Address
Authority identifiers.

svn path=/trunk/; revision=6954
2003-01-21 05:04:07 +00:00
Guy Harris 8e1a648203 Fix the formal argument list to "bytestring_to_str()" to match the
changes to the actual argument lists in the calls (putting the byte
string length after the byte string pointer).

Make the byte string length actually be the length, not the length - 1.

Use a #define for the longest byte string it can handle, and put in a
"g_assert()" to check the sanity of that length.

svn path=/trunk/; revision=6774
2002-12-10 07:39:48 +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
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
Guy Harris 0b8419fd5b Note why we're including <sys/socket.h> and <winsock2.h> in places where
we're including them to get AF_ values.

Shuffle the order of those includes in "inet_pton.c" to match the order
in "inet_ntop.c".

Include <winsock2.h> in "resolv.c" and "to_str.c" so that we get AF_
values from it - including AF_INET6 - if they exist, as we want to have
everybody who uses AF_INET6 get the same value.

svn path=/trunk/; revision=6517
2002-10-29 00:28:11 +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
Guy Harris 38d08c8883 <netinet/in.h> is needed for <arpa/inet.h>, at least on some platforms,
and <sys/types.h> is needed for <netinet/in.h>.

svn path=/trunk/; revision=5936
2002-08-03 19:35:16 +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 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<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>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Guy Harris 07c2ce1bad Get rid of no-longer-necessary includes of <sys/time.h>.
svn path=/trunk/; revision=3936
2001-09-14 07:23:34 +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 b7255e108a Fixes, from Scott Renfro, for some calls to "localtime()" that didn't
check whether the call succeeded (it doesn't always do so on Windows,
for example).

svn path=/trunk/; revision=3722
2001-07-15 19:14:03 +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
Guy Harris 52025d6956 Display all the digits of the microsecond field of an absolute time
value.

Check that the microseconds field of an absolute time is valid, if it's
present.

Set "tm_isdst" in the "struct tm" handed to "mktime()" to -1, so that
"mktime()" will attempt to figure out whether the time is daylight
savings time or not.

Check that "mktime()" was able to convert the time.

svn path=/trunk/; revision=3487
2001-05-31 06:48:00 +00:00
Guy Harris 73daa09911 We now might print four IP addresses on a protocol tree line, so make
"ip_to_str()" capable of producing up to four separate strings.

svn path=/trunk/; revision=3474
2001-05-28 20:12:30 +00:00
Guy Harris 6270db715c Include <string.h> to declare "strlen()", and include <winsock.h> to
declare "struct timeval", so that MSVC++ 6.0 doesn't give an error.

svn path=/trunk/; revision=3247
2001-04-02 10:44:09 +00:00
Guy Harris ce01c4e7ef "to_str.c" uses "size_t"; include <stdlib.h>, to declare it (necessary
on Windows).

svn path=/trunk/; revision=3244
2001-04-02 09:59:41 +00:00
Guy Harris 13681cf12b Include <sys/time.h> as well as <time.h> in "column-utils.c" and
"value_string.c", as they include "epan/to_str.h", and that uses "struct
timeval" in some function prototypes.

In "to_str.c", include <sys/types.h> before including <netinet/in.h>; on
at least some platforms, definitions in <netinet/in.h> require types
defined in <sys/types.h>.

In "to_str.c", include <sys/socket.h>, so that AF_INET6 is defined.

svn path=/trunk/; revision=3238
2001-04-02 02:30:06 +00:00
Ed Warnicke 80f1da63b0 Added #include<sys/time.h> to to_str.c
svn path=/trunk/; revision=3232
2001-04-01 17:35:21 +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