Commit Graph

279 Commits

Author SHA1 Message Date
Kovarththanan Rajaratnam 80a6d3fbcf Introduce epan_dissect_init()/epan_dissect_cleanup(). These are used to initialise/cleanup stack allocated 'edt' structures. This should speed up dissection since we avoid some malloc traffic.
svn path=/trunk/; revision=29404
2009-08-13 19:42:46 +00:00
Guy Harris cf91fdf16b Have tap listeners specify whether the "packet" routine requires
a protocol tree;

	the column values.

This includes stats-tree listeners.

Have the routines to build the packet list, and to retap packets, honor
those requirements.  This means that cf_retap_packets() no longer needs
an argument to specify whether to construct the column values or not, so
get rid of that argument.

This also means that there's no need for a tap to have a fake filter
to ensure that the protocol tree will be built, so don't set up a fake
"frame" filter.

While we're at it, clean up some cases where "no filter" was represented
as a null string rather than a null pointer.

Have a routine to return an indication of the number of tap listeners
with filters; use that rather than the global num_tap_filters.

Clean up some indentation and some gboolean vs. gint items.

svn path=/trunk/; revision=28645
2009-06-05 22:42:47 +00:00
Bill Meier fa920e48ed Minor cleanup of "-h" output text.
svn path=/trunk/; revision=28334
2009-05-12 16:06:14 +00:00
Gerald Combs e648060f0f Fix the last(?) of the Win64 compilation problems.
svn path=/trunk/; revision=28065
2009-04-16 04:05:39 +00:00
Gerald Combs 4400c3393e Rawshark fixes from Duncan Salerno.
svn path=/trunk/; revision=27919
2009-03-31 23:38:31 +00:00
Guy Harris c73ab7dff7 Change the signature of init_progfile_dir() so the casting of the
function pointer (to main) to an argument to dladdr() is done in
init_progfile_dir() rather than its callers.

svn path=/trunk/; revision=27814
2009-03-22 06:53:17 +00:00
Guy Harris 6f059e8cb7 In Solaris, the second argument to dladdr() is just a void *, not a
const void *.

svn path=/trunk/; revision=27813
2009-03-22 06:38:02 +00:00
Guy Harris 7c6e2155cc Attempt to use dladdr() to get the pathname of the executable image if
it's available and works.

svn path=/trunk/; revision=27812
2009-03-22 00:42:33 +00:00
Guy Harris ace4af44fc Add a routine to report write errors to the list of failure-reporting
routines handled by epan/report_err.c.

Move copy_binary_file() in file.c to epan/filesystem.c, and rename it to
copy_file_binary_mode() (to clarify that it *can* copy text files;
arguably, *all* files are "binary" unless you're on, say, an IBM 1401
:-)).  Have it use the report_err.c routines, so it works in
console-mode programs.

Clean up some comments while we're at it.

svn path=/trunk/; revision=27456
2009-02-15 21:47:57 +00:00
Bill Meier ee908a7abd #include <epan/conversation.h> not req'd ...
svn path=/trunk/; revision=27392
2009-02-07 16:01:26 +00:00
Guy Harris 48ea0b2fc7 Fix error reporting - just use fprintf(stderr, ...), give the path name
of the pipe to be opened in the messages.

Check whether strtol() succeeds.

Map DLT_ values to a WTAP_ENCAP_ value regardless of whether it comes
from linktype_name_to_val() or strtol().

Clean up indentation.

svn path=/trunk/; revision=27075
2008-12-21 23:37:29 +00:00
Guy Harris 44f8cae6ab If we don't have any of the pcap_datalink_XXX_to_YYY routines,
substitute our own (I wrote them all, so I can steal them from the
BSD-licensed libpcap if I want :-)).  This means that
linktype_name_to_val() and linktype_val_to_name() are always available,
and we don't need to #ifdef use of them.

Use pcap_datalink_val_to_description() to get the description for a
particular DLT_ value, rather than mapping the DLT_ value to a
WTAP_ENCAP_ value and getting the description for the latter.

svn path=/trunk/; revision=27074
2008-12-21 23:22:12 +00:00
Jaap Keuter 7f36dc44ce Fix for bug 2823:
Do not pass automatic variable back into caller space.

svn path=/trunk/; revision=26425
2008-10-13 06:54:19 +00:00
Bill Meier afd857957a Fix a few Emacs "file variables" to have "safe" values.
That is: indent-tabs-mode: tabs --> indent-tabs-mode: t
Also: fix a typo: set-tabs-mode --> indent-tabs-mode

svn path=/trunk/; revision=26113
2008-09-02 11:17:03 +00:00
Bill Meier 224b638586 #include <emem.h> not req'd
svn path=/trunk/; revision=26093
2008-08-26 02:38:57 +00:00
Gerald Combs 2f5f9ae606 Remove dead code found in Coverity CID 271.
svn path=/trunk/; revision=25831
2008-07-25 18:51:44 +00:00
Jeff Morriss 83f9ecf96f Move privileges.c and unicode-utils.c from epan to wsutil (so things like
capinfos and dumpcap don't need to depend on libwireshark nor directly pull
in those modules).  Because capinfos and editcap were only being linked with
privileges.c if we had plugins, this allows those programs to be linked when
someone is compiling --without-plugins.

svn path=/trunk/; revision=25640
2008-06-30 17:16:29 +00:00
Jeff Morriss a5cee04fad Move the file utility functions from wiretap to libwsutil so that
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.

While doing that, rename the eth_* functions to ws_*.

svn path=/trunk/; revision=25354
2008-05-22 15:46:27 +00:00
Anders Broman 3d39efc2c3 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25248
2008-05-07 05:26:40 +00:00
Sake Blok f17067c174 Make tshark and rawshark behave similar to wireshark when "frame.time_delta_displayed" is
used within a display filter.

(the usefullness of "frame.time_delta_displayed" in a display filter is very limited
 since it bites it's own tail. Still, wireshark and tshark should at least show the
 same behaviour)


svn path=/trunk/; revision=24708
2008-03-21 06:11:45 +00:00
Jeff Morriss 70a53138b3 From Peter Fuller: free pref_str in set_link_type() if preferences aren't set. From me: call get_credential_inf() at startup.
svn path=/trunk/; revision=24656
2008-03-16 15:29:13 +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
Bill Meier 01704fde45 g_strncasecmp --> g_ascii_strncasecmp
svn path=/trunk/; revision=24443
2008-02-23 17:06:57 +00:00
Gerald Combs 022a248f4c Convert any supplied encapsulation from libpcap to wiretap so that DLTs other
than Ethernet work.

svn path=/trunk/; revision=24403
2008-02-20 18:02:03 +00:00
Bill Meier 2f9f8d7df8 Fix some some properties
svn path=/trunk/; revision=24380
2008-02-18 21:01:11 +00:00
Stig Bjørlykke 17504c44ad Add a missing default case to avoid a warning.
svn path=/trunk/; revision=24367
2008-02-17 00:04:49 +00:00
Guy Harris f10febad71 Now that we're no longer linking with capture_info.c, etc., we don't
need a bunch of dummy routines.

svn path=/trunk/; revision=24344
2008-02-16 02:31:31 +00:00
Gerald Combs 7706f9e17e Fix compilation on non-Windows systems.
svn path=/trunk/; revision=24340
2008-02-16 01:00:01 +00:00
Gerald Combs 98bacb3556 Add rawshark, a utility that, when given raw pcap-formatted packets and
a list of fields, prints the field values found in each packet.

Packet data can be specified as a libpcap DLT, e.g. "EN10MB" or an upper-layer protocol, e.g. "http".

svn path=/trunk/; revision=24339
2008-02-15 23:20:32 +00:00