Commit Graph

77 Commits

Author SHA1 Message Date
Michael Mann da09a1bfd8 Take all epan_column_info members that always get allocated to "number of columns" to share their own data structure.
Change-Id: Ib982662db6cf68730a7d121eac60d9bc5ae67429
Reviewed-on: https://code.wireshark.org/review/9195
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-29 02:11:04 +00:00
Guy Harris cfcbb28671 Clean up ftype-conversion and dfilter error message string handling.
Have dfilter_compile() take an additional gchar ** argument, pointing to
a gchar * item that, on error, gets set to point to a g_malloc()ed error
string.  That removes one bit of global state from the display filter
parser, and doesn't impose a fixed limit on the error message strings.

Have fvalue_from_string() and fvalue_from_unparsed() take a gchar **
argument, pointer to a gchar * item, rather than an error-reporting
function, and set the gchar * item to point to a g_malloc()ed error
string on an error.

Allow either gchar ** argument to be null; if the argument is null, no
error message is allocated or provided.

Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c
Reviewed-on: https://code.wireshark.org/review/6608
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 10:22:59 +00:00
Stig Bjørlykke d58567bd78 Fixed memory leakage in col_cleanup.
Several fields in cinfo is allocated memory and must be freed here
to avoid memory leakage when recreating the packet list.

Do not allocate memory for col_expr[] as this points to static strings
or other allocated strings.

Change-Id: I840377e3c590b1a3e2a38e0537465a028041d1e9
Reviewed-on: https://code.wireshark.org/review/5137
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-10 08:00:56 +00:00
Guy Harris 19b7819694 Get rid of unnecessary includes of ctype.h.
Change-Id: Ibb194cd839d174af9c96f7bb1e2941b3dd6c1ce1
Reviewed-on: https://code.wireshark.org/review/4797
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:31:20 +00:00
Guy Harris 54b733ce9a Make the time stamp resolution per-packet.
Pcap-ng files don't have a per-file time stamp resolution, they have a
per-interface time stamp resolution.  Add new time stamp resolution
types of "unknown" and "per-packet", add the time stamp resolution to
struct wtap_pkthdr, have the libwiretap core initialize it to the
per-file time stamp resolution, and have pcap-ng do the same thing with
the resolution that it does with the packet encapsulation.

Get rid of the TS_PREC_AUTO_XXX values; just have TS_PREC_AUTO, which
means "use the packet's resolution to determine how many significant
digits to display".  Rename all the WTAP_FILE_TSPREC_XXX values to
WTAP_TSPREC_XXX, as they're also used for per-packet values.

Change-Id: If9fd8f799b19836a5104aaa0870a951498886c69
Reviewed-on: https://code.wireshark.org/review/4349
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-28 18:38:18 +00:00
Guy Harris 006790927f Make get_column_longest_string() static.
It's not used outside epan/column.c, so don't export it.

Change-Id: I38e084946d92f3c31b06fc4fc1991c88e652f58a
Reviewed-on: https://code.wireshark.org/review/4334
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-27 18:29:31 +00:00
Bill Meier c0b0a11e4e (Pedantic): set editor modelines tab-width & etc to 8; Also: fix some indentation in packet-sip.c
Change-Id: I623fc5e4c1247dbe5e15f0f33270f4f0994268ab
Reviewed-on: https://code.wireshark.org/review/943
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-04-03 15:31:56 +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
Jakub Zawadzki 0f8572cb51 Avoid including definition of column_info structure in dissectors.
Move COL_* enum to <epan/column-utils.h>

XXX Later we can rename epan/column-info.h to column-int.h (or smth like this)

svn path=/trunk/; revision=54352
2013-12-22 10:41:27 +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
Chris Maynard e41d5b9049 Provide a usage example of the column formats.
svn path=/trunk/; revision=52802
2013-10-23 17:47:47 +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
Chris Maynard 63e4539229 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9272
Add tshark -G column-formats report and document the missing ftypes, heuristic-decodes and plugins reports.

From me: Sort the reports.  Add modelines to epan/column.c.  Minor whitespace changes.

svn path=/trunk/; revision=52627
2013-10-15 18:27:35 +00:00
Bill Meier 6499394c78 Declare slist[] as static (reduces storage & code executed: *See below);
Declare dlist[] similarly to slist[] (not really needed since generated storage/code was OK as is)

*On Windows the following program generates sub-optimal code
 (when built using VC10 or VC11 with CFLAGS as used when building Wireshark).

void foo(void) {
    const char *const zz[] = {"ABC", "abc"};
}
-------------

Code generated:

<snip>
_DATA	SEGMENT
$SG1013	DB	'ABC', 00H  !!! note string stored twice !!
$SG1014	DB	'ABC', 00H
$SG1015	DB	'abc', 00H
$SG1016	DB	'abc', 00H
_DATA	ENDS

<snip>
; 1    : void foo(void) {

	push	ebp
	mov	ebp, esp
	sub	esp, 8

; 2    :     const char *const zz[] = {"ABC", "abc"};

	mov	DWORD PTR _zz$[ebp], OFFSET $SG1014    !! note: each ptr of array
	mov	DWORD PTR _zz$[ebp+4], OFFSET $SG1016  !!  individually pushed on stack

<snip>

Not shown: Declaring zz as 'static' generates much better code....


svn path=/trunk/; revision=50271
2013-06-30 23:03:20 +00:00
Jeff Morriss a441793cba Move a couple of time-related modules into wsutil.
A bunch of files didn't really need to include these header files so remove
the include line rather than changing it.

svn path=/trunk/; revision=50154
2013-06-25 22:02:20 +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
Jakub Zawadzki bc67498fb4 cleanup get_column_format_matches()
fmt_list[format] is set to TRUE on begin of function as 'obvious' thing to do

svn path=/trunk/; revision=44494
2012-08-14 16:58:34 +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 a6ccc83e22 If we set "column.hidden" on the command line but don't set
"column.format" in a later argument, make sure we mark the appropriate
existing columns as hidden.

As part of cleaning up the infrastructure for doing this, store the COL_
code for a column in a fmt_data structure rather than a pointer to the
raw column format string; this simplifies some code.

Have a routine to return whether a column is visible, not hidden, as
it's used to set a "visible" flag.

svn path=/trunk/; revision=39822
2011-11-13 22:51:49 +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 ccfe41300c Added "Edit Column Details" functions to the packet list heading popup.
Removed "Rename Column Title" as this is moved to "Edit Column Details".

svn path=/trunk/; revision=34444
2010-10-09 15:22:53 +00:00
Sake Blok 7364bef1b3 When using a custom column, make it possible to select which occurrence to show if the field has multiple occurrences.
svn path=/trunk/; revision=34186
2010-09-22 20:56:14 +00:00
Stig Bjørlykke beb4314276 Introduce "Show Resolved" as an option in custom columns. This will determine
if we show the value or the string representing the value.

This setting is not stored in the preferences file yet, and the option is
not available in the columns preferences window.

svn path=/trunk/; revision=33317
2010-06-25 06:42:34 +00:00
Stig Bjørlykke d3e1e2df1e Added "Hide Column" functionality.
svn path=/trunk/; revision=33266
2010-06-20 16:23:43 +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
Gerasimos Dimitriadis c08fa6f3cf Move underscore escaping/unscaping function to strutil.c;
Update decoding of IS-801 Request GPS Acquisition Assistance

svn path=/trunk/; revision=31685
2010-01-26 18:21:17 +00:00
Gerasimos Dimitriadis e50527b8e1 Handle underscore escaping/unescaping for old packet list; Simplify
and make more robust the unescaping function.

svn path=/trunk/; revision=31668
2010-01-25 20:30:09 +00:00
Gerasimos Dimitriadis 065546cdcb Change the prefix of the underscore escaping/unescaping
functions from g_ to ws_; Insert function names in
libwireshark.def

svn path=/trunk/; revision=31662
2010-01-25 18:14:01 +00:00
Gerasimos Dimitriadis 11e340038f Handle underscore escaping/unescaping of the column titles
under the new packet list

svn path=/trunk/; revision=31649
2010-01-24 22:25:40 +00:00
Stig Bjørlykke 4fe9d51d78 Corrected some return values.
svn path=/trunk/; revision=30534
2009-10-12 09:13:37 +00:00
Stig Bjørlykke 96b31924f0 Added check for valid column in get_column_title() and
get_column_custom_field().

svn path=/trunk/; revision=30531
2009-10-12 08:04:30 +00:00
Stig Bjørlykke 23c0b494a7 Return from get_column_format() when invalid column requested.
svn path=/trunk/; revision=30530
2009-10-12 07:56:26 +00:00
Kovarththanan Rajaratnam b90a11bee3 Make tshark and rawshark use build_column_format_array() instead of duplicating the code
svn path=/trunk/; revision=29803
2009-09-08 17:29:57 +00:00
Guy Harris 6899bdc299 Note in dlist[] that COL_BSSGP_TLLI is deprecated.
svn path=/trunk/; revision=29547
2009-08-25 06:11:57 +00:00
Anders Broman 2dd60e1b66 Custom columnfication:
* Deprecate COL_BSSGP_TLLI (GPRS BSSGP IE TLLI). Use bssgp.tlli

svn path=/trunk/; revision=29546
2009-08-25 05:42:14 +00:00
Kovarththanan Rajaratnam b9cbd15469 Custom columnfication:
* Deprecate COL_REL_CONV_TIME (Relative time (conversation)). Use tcp.time_relative

svn path=/trunk/; revision=29523
2009-08-23 12:24:14 +00:00
Kovarththanan Rajaratnam 55cf35e3a0 Custom columnfication:
* Deprecate COL_FR_DLCI (Frame Relay DLCI). Use fr.dlci

svn path=/trunk/; revision=29522
2009-08-23 12:16:10 +00:00
Kovarththanan Rajaratnam 00670c55c6 Custom columfication:
* Deprecate COL_HPUX_DEVID (HP-UX Device ID). Use nettl.devid

svn path=/trunk/; revision=29517
2009-08-23 10:25:51 +00:00
Kovarththanan Rajaratnam 205129d25c Custom columfication:
* Deprecate COL_HPUX_SUBSYS (HP-UX Nettl Subsystem). Use nettl.subsys

svn path=/trunk/; revision=29516
2009-08-23 10:20:42 +00:00
Kovarththanan Rajaratnam 6b89de8393 Custom columfication:
* Deprecate COL_COS_VALUE (L2 COS Value (802.1p)). Use vlan.priority

svn path=/trunk/; revision=29513
2009-08-23 09:07:54 +00:00
Anders Broman ded297677f From Kovarththanan Rajaratnam:
Precompile custom columns filters.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3767

svn path=/trunk/; revision=29174
2009-07-23 05:48:39 +00:00
Gerald Combs 6348c17c16 size_t fixes.
svn path=/trunk/; revision=27984
2009-04-07 16:36:52 +00:00
Jaap Keuter acdf91e263 Make "Copy as Filter" on the packet list actually work.
Up till now every packet in the packet list got a copy of the pointer to the filter expressions for
the last packets' columns. Hence any 'Copy as Filter" on a column got the expression of the last
packet in the packet list. Instead every packet needs to get a pointer to the filter expressions 
for its own columns. This requires making a copy of the filter expressions themselves.

Since this is a bug in 1.0 as well the GLIB1 code is provided for backporting, which can later be dropped from the development tree.

svn path=/trunk/; revision=27396
2009-02-09 07:10:46 +00:00
Ulf Lamping 1f8e6c08be various code cleanup
svn path=/trunk/; revision=24964
2008-04-12 23:34:44 +00:00
Stig Bjørlykke 41e9bde037 Added an option to save column widths in the recent file.
Not 100% implemented for usage with configuration profiles with 
different column layout yet, as this requires some of the recent
values to be saved in each profile.

svn path=/trunk/; revision=24949
2008-04-12 19:37:05 +00:00
Stephen Fisher 56226b49b8 Custom column updates:
- Change apply / prepare / ... as filter to use the field's value, which
   is now stored in fdata as well as cinfo.  Now we don't have to reprocess
   the entire packet list when using these features.  This also prevents
   the use of these features from overwriting custom column information.
   (custom columns can now be used in apply / prepare ... as filter)
 - Break col_expr and col_expr_val out into a struct that is included not only
   in cinfo, but now also fdata.
 - Have col_custom_set_fstr() quote FT_STRING & FT_STRINGZ when storing the
   col_expr_val value (for filter creation).


svn path=/trunk/; revision=24511
2008-03-01 05:16:45 +00:00
Stephen Fisher 96ade54c54 Fix a comment that was pointing readers to the wrong file to look for info
svn path=/trunk/; revision=24486
2008-02-27 04:44:33 +00:00