Commit Graph

63 Commits

Author SHA1 Message Date
darkjames 43d81ff849 Add missing code to handle fields with an extended value_string (BASE_EXT_STRING)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36749 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-21 09:50:12 +00:00
guy bf5d8d18e3 Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code.  Have it also supply a err_info string, and
report it.  Have file_error() supply an err_info string.

Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.

Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36748 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-21 09:41:52 +00:00
guy c6de809d9c Rename ws_stat to ws_stat64, and make it take a pointer to a ws_statb64
as an argument, along the lines of ws_fstat64, and, on Windows, make it
use _wstati64, to handle 64-bit file sizes.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36547 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-10 20:59:10 +00:00
gerald eb492e28af On Windows, convert all of our command-line arguments from UTF-16 to
UTF-8 where we don't already do so. In Wireshark use g_utf16_to_utf8
instead of utf_16to8. This should fix bug 5520.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35411 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-06 23:28:58 +00:00
jake f61aa44bfa Avoid the need for cf_mark_frame stubs.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35248 f5534014-38df-0310-8fa8-9805f1628bb7
2010-12-22 23:09:31 +00:00
stig 137c3eacfe Fixed "Compiled with" information in the About box.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34601 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-21 07:13:43 +00:00
gerald addaaa21b9 Revision 27919 added the ability to feed a libpcap-formatted file to
rawshark but broke the ability to feed it live packets with a
pcap_pkthdr prefix on some 64-bit architectures.

Add a "-p" flag which lets us explicitly handle file-based or
memory-based packet record headers.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34522 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-15 16:05:06 +00:00
wmeier a7f84bd74c Rename g_resolv_flags --> gbl_resolv_flags; Also: cleanup some whitespace & indentation.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34487 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-12 13:15:08 +00:00
gerald e44e7544c6 Turn on ASLR via /DYNAMICBASE and DEP via SetProcessDEPPolicy().
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34137 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-16 19:20:06 +00:00
guy 4b21238141 Move the code to get version information for libraries used by
libwireshark into libwireshark, and call it only in programs linked with
libwireshark.  That way, programs that don't link with libwireshark
don't have to link with libgcrypt or libgnutls solely so that they can
say that they're linked with a particular version of libgcrypt or
libgnutls.

Don't link dumpcap with libgcrypt or libgnutls any more.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33531 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-15 02:07:16 +00:00
guy 5df7d8da81 Get rid of no-longer-used variable.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33511 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-14 02:12:55 +00:00
morriss da0f3a2fe7 Move some code (including the optional objects) into libwsutil
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33012 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-28 20:19:55 +00:00
stig 322dd1f8cb Set default seconds type in rawshark and dftest.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32709 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-07 06:35:17 +00:00
wmeier 8ab8db0d7c Let's not use tabs with tab-width=4; Convert tabs to spaces (with indent=4).
Also: use consistent indentation & remove any trailing blanks.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32588 f5534014-38df-0310-8fa8-9805f1628bb7
2010-04-28 16:23:53 +00:00
guy 6ac257c981 "capture-pcap-util.h" include <pcap.h>, and <pcap.h>, for better or
worse, has no include-once guards; include it only once.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32110 f5534014-38df-0310-8fa8-9805f1628bb7
2010-03-04 07:19:43 +00:00
stig e2b4218dde Added svn:ignore targets.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32055 f5534014-38df-0310-8fa8-9805f1628bb7
2010-02-28 21:09:28 +00:00
guy 40fae42f5a Move the declarations of wtap_pcap_encap_to_wtap_encap() and
wtap_wtap_encap_to_pcap_encap() to wiretap/pcap-encap.h.  Include it
where it's needed; don't include other Wiretap headers where they're not
needed.

Include pcapng.h in pcapng.c, to declare the functions defined in
pcapng.c.  Add some casts to squelch some warnings, and add to a comment
to indicate one of the problems.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31960 f5534014-38df-0310-8fa8-9805f1628bb7
2010-02-23 03:50:42 +00:00
guy 69af4b2174 Squelch some warnings.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31959 f5534014-38df-0310-8fa8-9805f1628bb7
2010-02-23 03:23:46 +00:00
wmeier 4637a51a41 Fix various gcc -Wshadow warnings.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31729 f5534014-38df-0310-8fa8-9805f1628bb7
2010-01-29 16:09:25 +00:00
guy 3076911330 For fields of type FT_ABSOLUTE_TIME, have the "display" value be one of
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display
the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL ==
(int)BASE_NONE, so there's no source or binary compatiblity issue,
although we might want to eliminate BASE_NONE at some point and have the
BASE_ values used with integral types start at 0, so that you can't
specify BASE_NONE for an integral field.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31319 f5534014-38df-0310-8fa8-9805f1628bb7
2009-12-19 03:17:44 +00:00
stig 78a17bcd79 Removed an unused assignment.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30915 f5534014-38df-0310-8fa8-9805f1628bb7
2009-11-10 09:09:25 +00:00
stig 72676c1263 Invert check for getopt: NEED_GETOPT_H -> HAVE_GETOPT_H
Rename getopt.[ch] -> wsgetopt.[ch] to avoid name collision.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30370 f5534014-38df-0310-8fa8-9805f1628bb7
2009-10-06 16:01:18 +00:00
krj ab7087df1e Rename init_cap_file() to cap_file_init()
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30073 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-22 16:53:11 +00:00
krj df61f09bd4 Make frame_data_set_after_dissect() callers do the necessary checks instead
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30068 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-22 14:50:43 +00:00
krj 02f02664da Refactor frame_data_init() into frame_data_set_before_dissect() and frame_data_set_after_dissect().
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30066 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-22 14:23:20 +00:00
krj b96d4e4d2b Move 'Delta timestamp to previous captured frame' calculation inside add_packet_to_packet_list(). This is done in order to streamline add_packet_to_packet_list() with frame_data_init(). Hopefully we can switch to frame_data_init() soon
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30052 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-21 19:30:06 +00:00
krj 8036b99ebc Move frame_data_init() declaration to frame_data.h
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30033 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-21 11:26:23 +00:00
krj 366ddb323f Fix return type for frame_data_init()
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30024 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-20 19:01:23 +00:00
krj 82d11d908f Introduce frame_data_cleanup() and start using it
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30023 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-20 18:18:29 +00:00
krj b3917034c4 Use frame_data_init() instead of the locally defined fill_in_fdata(), which will be removed as part of this change
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30022 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-20 18:02:22 +00:00
krj 4c49d018d0 Move verbose banner output to show_version() and tighten scope of some variables
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30020 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-20 17:45:17 +00:00
krj e852ab7fe8 Make tshark and rawshark use build_column_format_array() instead of duplicating the code
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29803 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-08 17:29:57 +00:00
krj 8b75640d5b Store the packet encapsulation type as gint8. Saves 3 bytes per packet
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29767 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-07 13:54:46 +00:00
krj 08963ce918 Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29754 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-06 18:25:23 +00:00
krj 6bd9953293 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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29404 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-13 19:42:46 +00:00
guy fdaebbf497 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28645 f5534014-38df-0310-8fa8-9805f1628bb7
2009-06-05 22:42:47 +00:00
wmeier 00a048f2b3 Minor cleanup of "-h" output text.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28334 f5534014-38df-0310-8fa8-9805f1628bb7
2009-05-12 16:06:14 +00:00
gerald ebaddf5c97 Fix the last(?) of the Win64 compilation problems.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28065 f5534014-38df-0310-8fa8-9805f1628bb7
2009-04-16 04:05:39 +00:00
gerald e562f6e166 Rawshark fixes from Duncan Salerno.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27919 f5534014-38df-0310-8fa8-9805f1628bb7
2009-03-31 23:38:31 +00:00
guy c522ae3b17 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27814 f5534014-38df-0310-8fa8-9805f1628bb7
2009-03-22 06:53:17 +00:00
guy 1f905853fb In Solaris, the second argument to dladdr() is just a void *, not a
const void *.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27813 f5534014-38df-0310-8fa8-9805f1628bb7
2009-03-22 06:38:02 +00:00
guy ad4407127e Attempt to use dladdr() to get the pathname of the executable image if
it's available and works.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27812 f5534014-38df-0310-8fa8-9805f1628bb7
2009-03-22 00:42:33 +00:00
guy 1372d880e4 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27456 f5534014-38df-0310-8fa8-9805f1628bb7
2009-02-15 21:47:57 +00:00
wmeier 5f727cba01 #include <epan/conversation.h> not req'd ...
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27392 f5534014-38df-0310-8fa8-9805f1628bb7
2009-02-07 16:01:26 +00:00
guy ab66f629c4 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27075 f5534014-38df-0310-8fa8-9805f1628bb7
2008-12-21 23:37:29 +00:00
guy fd4044b5c5 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27074 f5534014-38df-0310-8fa8-9805f1628bb7
2008-12-21 23:22:12 +00:00
jake 5d8ff9cca1 Fix for bug 2823:
Do not pass automatic variable back into caller space.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26425 f5534014-38df-0310-8fa8-9805f1628bb7
2008-10-13 06:54:19 +00:00
wmeier acd19df252 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


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26113 f5534014-38df-0310-8fa8-9805f1628bb7
2008-09-02 11:17:03 +00:00
wmeier e4cc95554f #include <emem.h> not req'd
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26093 f5534014-38df-0310-8fa8-9805f1628bb7
2008-08-26 02:38:57 +00:00
gerald c7d9768a5f Remove dead code found in Coverity CID 271.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25831 f5534014-38df-0310-8fa8-9805f1628bb7
2008-07-25 18:51:44 +00:00