Commit Graph

242 Commits

Author SHA1 Message Date
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