Commit Graph

227 Commits

Author SHA1 Message Date
Guy Harris 2d0507e33a Use gsize rather than int, to avoid some complaints about shortening.
Change-Id: Ic673525a05cd106677226a4063af825d0f22c97c
Reviewed-on: https://code.wireshark.org/review/1677
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-17 22:29:27 +00:00
Jakub Zawadzki ea95c837fe Introduce col_add_lstr(), use it instead of slower col_add_fstr.
We have callgrind benchmarks which shows that col_add_fstr() takes
5% of Ir count cause of formatting done in g_vsnprintf().

New col_add_lstr() can be used in few dissectors without much ugliness,
and it should be a little faster.

Change-Id: Ifddd951063dfd3a27c2a7da4dafce9b242c0472c
Reviewed-on: https://code.wireshark.org/review/1629
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-17 21:33:26 +00:00
AndersBroman da00889226 Add a cast to make MSVC happy.
Change-Id: Iee901ae56c796007821c1754056c61954e8a342f
Reviewed-on: https://code.wireshark.org/review/1526
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 07:57:21 +00:00
Jakub Zawadzki ecc6b8d620 Move common part of col_append_fstr, col_append_sep_fstr to seperate fnction.
From the comments I think it was intended - but there were no G_VA_COPY macro in glib (?).

Change-Id: Ic1e1d4a5ac9e5b8f27f25487416c0ededeed2093
Reviewed-on: https://code.wireshark.org/review/1518
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 06:49:18 +00:00
Jakub Zawadzki 984e52244f Fix possible buffer overflow in col_append_sep_fstr()
After appending separator it might happen that len > max_len, in such case
g_vsnprintf() will overflow the col_buf buffer.

Change-Id: Ic5ff49d30e30509e835165c4cc7e72e31f92fd5f
Reviewed-on: https://code.wireshark.org/review/1493
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-05 03:58:42 +00:00
Guy Harris 97869f2dec More name changes.
Add ep_ to routines that may return ephemeral strings.

Change "get_XXX" to "XXX_to_display" if the routine returns a formatted
string if it can't get a name.

Change-Id: Ia0e82784349752cf4285bf82788316c9588fdd88
Reviewed-on: https://code.wireshark.org/review/1217
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-19 19:30:17 +00:00
Guy Harris c8f7e16b57 Some routine name changes.
"get_addr_name()" -> "ep_address_to_display()", to 1) indicate that it
returns a string with ephemeral scope and 2) indicate that it maps an
address to a "displayable" form - a name if possible, an address string
if not.

"se_get_addr_name()" -> "get_addr_name()", to indicate that its strings
have the same scope as "get_ether_name()", "get_hostname()", and
"get_hostname6()".

Change-Id: If2ab776395c7a4a163fef031d92b7757b5d23838
Reviewed-on: https://code.wireshark.org/review/1216
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-19 19:07:06 +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
Guy Harris 11220f625c Don't cast away constness.
svn path=/trunk/; revision=54797
2014-01-14 18:16:12 +00:00
Guy Harris fd4faf6619 Expand a comment.
svn path=/trunk/; revision=54622
2014-01-06 23:07:48 +00:00
Guy Harris 81b21459c3 In col_fill_in() and col_fill_in_error(), use col_based_on_frame_data()
to determine whether to fill in the column from frame data or not.

svn path=/trunk/; revision=54621
2014-01-06 23:02:32 +00:00
Stig Bjørlykke 80150e196a Added col_clear_fence().
svn path=/trunk/; revision=54220
2013-12-18 14:18:45 +00:00
Jakub Zawadzki cedb73c7f7 Dissectors should not use dfilter.h, don't include it.
XXX ncp2222 dissector is using dfilter_compile(), why?

svn path=/trunk/; revision=53766
2013-12-03 21:31:04 +00:00
Jakub Zawadzki 8be10b5662 Remove #if 0 code (introduced in r29489).
svn path=/trunk/; revision=53181
2013-11-09 10:00:54 +00:00
Guy Harris 2a088c1d53 Add support for displaying dates as year and day-of-year (1-origin).
In the process, fix various man page descriptions of the -t flag,
and add support for UTC absolute times in the iousers and iostat TShark
taps.

svn path=/trunk/; revision=53114
2013-11-06 20:39:09 +00:00
Michael Mann 3ead3a994a Remove "Cisco MDS-specific" fields from packet_info. 2 of the 3 fields were used strictly for columns that are considered "deprecated" and I think the third could be put in that category as well.
I assume the column enumerations haven't already been removed because of legacy "indexing issues", but if I'm wrong, we should definitely remove the columns altogether.  Could also see renaming columns to DEPRECATED_[X].

svn path=/trunk/; revision=52910
2013-10-27 23:18:19 +00:00
Jörg Mayer 662c7704f8 After looking for something in the column-*.h files and
not finding it, I finally found it in column_info.h
Renamed column_info.h to column-info.h to have consistency
with the column*h files.

svn path=/trunk/; revision=52667
2013-10-18 13:06:05 +00:00
Michael Mann d6950e2176 FINALLY remove the check_col API so that reviewers won't have to mention that it's deprecated. Now it just won't compile if its included in a dissector.
svn path=/trunk/; revision=52317
2013-10-01 15:30:22 +00:00
Jörg Mayer 029e258225 Explicitly include emem.h where it is needed
svn path=/trunk/; revision=51997
2013-09-13 08:16:50 +00:00
Jeff Morriss 2df54da6e2 Move a bunch of the crypt modules and pint.h into wsutil.
This means wsutil now links against libcrypt.

Protect a bunch of the crypt header files from multiple inclusion.

svn path=/trunk/; revision=51100
2013-08-01 23:34:47 +00:00
Jakub Zawadzki c702e92121 Replace relative timestamp with reference frame number. Saves 16B per frame.
svn path=/trunk/; revision=50772
2013-07-21 23:07:33 +00:00
Jakub Zawadzki 5d52e16734 Add helper function to epan_session which can be used to get absolute timestamp of given frame.
Remove ->prev_cap, for testing purpose also replace ->prev_dis with number of previously displayed frame number.

This patch reduce size of frame_data by 8B (amd64)
This is what (I think) was suggested by Guy in comment 13 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c13)

svn path=/trunk/; revision=50765
2013-07-21 20:48:30 +00:00
Chris Maynard d331c33b4f This should fix warning: to be safe all intermediate pointers in cast from 'gchar **' to 'const char **' must be 'const' qualified.
svn path=/trunk/; revision=50655
2013-07-16 02:34:44 +00:00
Bill Meier 8b9135e9b5 Indentation/Whitespace cleanup;
Add editor modelines.

svn path=/trunk/; revision=50146
2013-06-25 19:38:15 +00:00
Sake Blok 56cb987ef2 Fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7546
Make sure unresolved columns are indeed unresolved


svn path=/trunk/; revision=49776
2013-06-04 21:36:47 +00:00
Bill Meier 0df5a9390d From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397

svn path=/trunk/; revision=48438
2013-03-20 01:18:10 +00:00
Michael Mann 41bd69d601 LUA API improvements
1. Add col_set_fence() equivalent
2. Update __tostring function to actually return column text

From Hadriel Kaplan, bug 8295 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8295)

svn path=/trunk/; revision=47882
2013-02-25 20:43:06 +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
Evan Huus 43fadb88cb Add comment explaining the addr->hf field to column-utils for future
reference. Those lines were already starting to look like magic and
it's only been 24 hours.

svn path=/trunk/; revision=45806
2012-10-27 02:48:45 +00:00
Evan Huus 361aedec1f Create SET_ADDRESS_HF that takes an additional hf_ value that can be
used to override the filter generated from the address column.

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7728 (again).

svn path=/trunk/; revision=45792
2012-10-26 01:59:17 +00:00
Evan Huus c6b522bc70 Revert revision 44921.
See discussion on https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7728

svn path=/trunk/; revision=45791
2012-10-26 00:42:34 +00:00
Guy Harris 9d4d1a5794 col_cleanup() is undoing the allocations that col_init() does, so it's
freeing the allocated array of pointers, not what the pointers ported
to, so it should free col_data.  Note that it does that, and put it
after col_init() in the source file and header file.

Put in a comment explaining the MSVC bug that we're working around with
the casts.

svn path=/trunk/; revision=45393
2012-10-08 17:04:37 +00:00
Guy Harris 2ab082faca col_data is not necessarily set to point to something g_malloc()ated,
and, if it is, it might be set to point to col_buf, which gets g_free()d
in the next statement, so we shouldn't g_free() it.

svn path=/trunk/; revision=45391
2012-10-08 16:28:13 +00:00
Evan Huus fef6b09666 Explicitly cast away const-ness to fix windows build-bots.
svn path=/trunk/; revision=45390
2012-10-08 15:39:02 +00:00
Evan Huus 92c3bc0228 Don't leak all of our column data in packet_list_recreate (I think we still leak
some of it?).

Maybe part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7775

svn path=/trunk/; revision=45388
2012-10-08 15:12:45 +00:00
Jakub Zawadzki 72ca9d0e61 Store pointers to previously displayed and captured packet, not nstime_t deltas.
This commit reduces size (from 144B to 128B on AMD64) of frame_data structure.

Part of bug 5821: Reduce per-packet memory requirements.

svn path=/trunk/; revision=45071
2012-09-23 16:25:28 +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
Evan Huus 826bba705b From Pontus Fuchs via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7728
Make right-click + apply-as-filter work in the packet list for non-ethernet
frames (such as ieee 802.11 frames).

svn path=/trunk/; revision=44921
2012-09-15 20:16:14 +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
Anders Broman e83a8e4eee Use the correct symbols
COL_UTC_TIME and COL_UTC_DATE_TIME
insted of TS_UTC and TS_UTC_WITH_DATE.

svn path=/trunk/; revision=43957
2012-07-24 12:20:18 +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
Guy Harris b6ff142f60 Add a presence flag field to the packet information structure filled in
by Wiretap, to indicate whether certain fields in that structure
actually have data in them.

Use the "time stamp present" flag to omit showing time stamp information
for packets (and "packets") that don't have time stamps; don't bother
working very hard to "fake" a time stamp for data files.

Use the "interface ID present" flag to omit the interface ID for packets
that don't have an interface ID.

We don't use the "captured length, separate from packet length, present"
flag to omit the captured length; that flag might be present but equal
to the packet length, and if you want to know if a packet was cut short
by a snapshot length, comparing the values would be the way to do that.

More work is needed to have wiretap/pcapng.c properly report the flags,
e.g. reporting no time stamp being present for a Simple Packet Block.

svn path=/trunk/; revision=41185
2012-02-25 23:24:34 +00:00
Guy Harris 25125ae369 Well, we *did* go to a widget that invokes callback to get the text for
the columns, so we *can* clean up the exporting of col_set_fmt_time() by
not exporting it any more.

svn path=/trunk/; revision=40743
2012-01-28 02:21:03 +00:00
Anders Broman 5d82ea810d Make it possiblwe to creare a trime string from frame data.
svn path=/trunk/; revision=39036
2011-09-19 05:15:58 +00:00
Anders Broman bd87f77148 set_abs_time and friends always return 1.
svn path=/trunk/; revision=39027
2011-09-16 14:25:50 +00:00
Stig Bjørlykke 50be3577ab Support negative nsecs when viewing seconds with hours and minutes.
svn path=/trunk/; revision=38862
2011-09-02 11:46:33 +00:00
Anders Broman 2f05cf4dcf From Michael Mann:
Added ability to display UTC time or UTC time with date.  I liked having the
difference between UTC and local time, not just setting local=UTC.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2629

svn path=/trunk/; revision=37898
2011-07-04 21:43:34 +00:00
Stig Bjørlykke d201977d9c Don't assert on invalid custom columns, just set as invalid/unknown.
This fixes bug 6028.

svn path=/trunk/; revision=37756
2011-06-22 20:15:34 +00:00
Guy Harris c8d2cd3cb5 In packet_list_dissect_and_cache_record(), set the columns to
*something* if we get an error reading the packet from the capture file,
rather than leaving them as null (which will cause a crash).

svn path=/trunk/; revision=36527
2011-04-09 04:33:26 +00:00