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
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
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
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
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
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
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
- 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
- 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
- automatic adjustment depending on file format
- manual adjustment through menu items
save the setting in the recent file
svn path=/trunk/; revision=15534
-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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
"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
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
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
<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
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
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
"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