aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/netmon.c
AgeCommit message (Collapse)AuthorFilesLines
2018-06-22Declare lead_surrogate only in the block where it's used.Guy Harris1-3/+5
That makes it a bit clearer that we don't need to initialize it to zero before the loop. This fixes a Dead Store (Dead assignement/Dead increment) Warning found by Clang. Change-Id: Iabfc4b47a3c6300814492c37ccfb321afd0c54ea Reviewed-on: https://code.wireshark.org/review/28374 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-15Just extract the title length once.Guy Harris1-4/+4
Extract it into title_length before checking it, and then check the value of title_length. Change-Id: I7f2c334dbce5eeaa12cd5d8bb8e289852fd15c4f Reviewed-on: https://code.wireshark.org/review/28282 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-15Fix some "bad file" messages.Guy Harris1-2/+2
The number being compared against is the amount of data *remaining* in the comment information, not the *size* of the comment information. And it's unsigned, so format it with %u. Change-Id: I5f02302ad4acbc3b27655ff5518e6e56d464020d Reviewed-on: https://code.wireshark.org/review/28280 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-15Convert NetMon comment titles to UTF-8 when reading the file.Guy Harris1-10/+24
Fix indentation, and note that the comment "description" (contents) are RTF (as opposed to plain text). Change-Id: I668a08c06e39a32318454d2ee73933083c5cb516 Reviewed-on: https://code.wireshark.org/review/28279 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-15No need to check for a UTF-16 string's length being a multiple of 2.Guy Harris1-15/+9
utf_16_to_utf_8() just ignores the extra octet. Change-Id: I7bf003b674e5d9b0fb0265b0e8c6c142107084e3 Reviewed-on: https://code.wireshark.org/review/28277 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-14Fix indentation.Guy Harris1-2/+2
Change-Id: I6a3db704c9046ff696820ce157423c5867c2c2e8 Reviewed-on: https://code.wireshark.org/review/28275 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-14Fix the handling of paths in the process information.Guy Harris1-7/+203
Pathnames are not limited to 260 characters in recent versions of Windows; boost the limit to handle up to 32767 UTF-16 octet pairs worth of path. The pathname is in UTF-16-encoded Unicode; convert it to UTF-8 for our internal use. Bug: 14876 Change-Id: I4ef19fd47c7dbdd74dcaf31a7a80f432d57dbb0d Reviewed-on: https://code.wireshark.org/review/28273 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-13Get rid of TestBigEndian and AC_C_BIGENDIAN.Gerald Combs1-2/+2
Get rid of CMake's TestBigEndian and Autotools' AC_C_BIGENDIAN checks in favor of G_BYTE_ORDER. We use G_BYTE_ORDER elsewhere and TestBigEndian is noticeably slow on Windows. Change-Id: Idc1326294db9cbee8f6b6b11c2028fc4d19acbf0 Reviewed-on: https://code.wireshark.org/review/26462 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-09Generalize wtap_pkthdr into a structure for packet and non-packet records.Guy Harris1-61/+61
Separate the stuff that any record could have from the stuff that only particular record types have; put the latter into a union, and put all that into a wtap_rec structure. Add some record-type checks as necessary. Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2 Reviewed-on: https://code.wireshark.org/review/25696 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-07netmon: Initialize struct netmonrec_comment on allocStig Bjørlykke1-1/+1
This avoids an illegal pointer to free() on error. Bug: 14397 Change-Id: Id6e535141c7a3ee7b3d1822875b571e2199a5387 Reviewed-on: https://code.wireshark.org/review/25660 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-01-20wiretap: use SPDX identifiers (partial work).Dario Lombardo1-13/+1
Change-Id: I28436e003ce7fe31d53e6663f3cc7aca00845e4b Reviewed-on: https://code.wireshark.org/review/25392 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-09Use pcapng as the name of the file format.Guy Harris1-2/+2
At one point, I remember a discussion resulting in the official name of the next-generation replacement for pcap format being changed to "pcapng", with no hyphen. Make Wireshark reflect that. Change-Id: Ie66fb13a0fe3a8682143106dab601952e9154e2a Reviewed-on: https://code.wireshark.org/review/25214 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-1/+1
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-24Don't look at the comment or process table with pre-2.2 files.Guy Harris1-6/+17
NetMon apparently didn't zero out the file header, so those fields have random values in pre-2.2. Change-Id: I3aeede6ab273d57ca937a5e18e67223fb4ed18da Reviewed-on: https://code.wireshark.org/review/23666 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-07More [-Wmaybe-uninitialized] fixes with -OgJoão Valverde1-0/+3
There may be some amount of bogosity involved but initialize the variables and add a default case to prevent the noise and the build from breaking with -Werror. Change-Id: I20432ea74a1e5edc28be75a97077c9aa7bc87a35 Reviewed-on: https://code.wireshark.org/review/23426 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-06NetMon: Add support for WiFi MessageMichael Mann1-0/+2
It's just a WTAP_ENCAP_IEEE_802_11 Change-Id: I7369fac06a7d63812bb7ce7b3c16b9fe606f544c Reviewed-on: https://code.wireshark.org/review/23418 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-05Ensure process info offset is "seek"ed when process info exists in NetMon file.Michael Mann1-0/+5
Change-Id: I85fd990781a47e738c22bff0218aabdc04122e15 Reviewed-on: https://code.wireshark.org/review/23403 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-04Add support for WPFCapture "formats" from Microsoft Analyzer.Michael Mann1-1/+35
Normally a .cap file contains a network type that when masked with 0xFFF will convert to a pcap LINKTYPE_ value. However, Microsoft Analyzer used 0xE080-0xE08A for their own purposes within a .cap file. Add support for the WPFCapture formats and give a "not supported" error message to the few left unsupported. Bug: 10556 Change-Id: I321a75ce769fdec75bdc6b595936c25932950a97 Reviewed-on: https://code.wireshark.org/review/23386 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-01Add support for NetMon NetmonFilter and NetworkInfoEx frame types.Michael Mann1-2/+6
Bug: 4221 Change-Id: I59aff777c364af1a064e1e99ea9ac6692a4cedfa Reviewed-on: https://code.wireshark.org/review/23333 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-31Read process info table from Netmon filesMichael Mann1-20/+214
There isn't a place at the moment that uses it, but prepare that use by parsing out the process info table and placing it the netmon private data. Bug: 4224 Ping-Bug: 1184 Change-Id: I6186b3dce0333042357089d8517c8b47b5ff7f70 Reviewed-on: https://code.wireshark.org/review/23316 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-30Add support for reading comments in Network Monitor filesMichael Mann1-22/+253
The NetMon wiretap reads the title and description comment fields from a NetMon file and saves it in the wiretap private structure. Then when it's time to make a frame, the comment fields are added to a NetMon pseudoheader with a new WTAP ENCAP type, with the potential for netmon pseudoheader to contain pseudoheader data from "base" wiretap. Then the netmon_header dissector displays the comment fields and passes any "base" wiretap pseudoheader data when calling the wtap_encap dissector table that the frame dissector normally calls. Bug: 4225 Change-Id: I8f772bc9494364c98434c78b61eb5a64012ff3b9 Reviewed-on: https://code.wireshark.org/review/23210 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-29Add Network Monitor Event Tracing eventMichael Mann1-1/+2
Assigned a WTAP_ENCAP value (WTAP_ENCAP_NETMON_NET_NETEVENT) for the dissection of Event Tracing records inside a NetworkMonitor file. Ping-Bug: 6520 Ping-Bug: 6694 Change-Id: Ib100f3779095842e78f9b7741e80258aa866d818 Reviewed-on: https://code.wireshark.org/review/23278 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-05Allow bigger snapshot lengths for D-Bus captures.Guy Harris1-3/+3
Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except for D-Bus captures. Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for them, because that's the largest possible D-Bus message size. See https://bugs.freedesktop.org/show_bug.cgi?id=100220 for an example of the problems caused by limiting the snapshot length to 256KB for D-Bus. Have a snapshot length of 0 in a capture_file structure mean "there is no snapshot length for the file"; we don't need the has_snap field in that case, a value of 0 mean "no, we don't have a snapshot length". In dumpcap, start out with a pipe buffer size of 2KB, and grow it as necessary. When checking for a too-big packet from a pipe, check against the appropriate maximum - 128MB for DLT_DBUS, 256KB for everything else. Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20 Reviewed-on: https://code.wireshark.org/review/21952 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-06*_stdup_printf -> strdup for "single string only" formatting.Michael Mann1-1/+1
Done for performance improvements. This could probably be done in checkAPIs.pl, but this was just a quick manual check with grepping. Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d Reviewed-on: https://code.wireshark.org/review/15751 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2015-12-24Refactor 802.11 radio flags.Simon Barber1-1/+1
The use of a flag field here is aesthetically unpleasing when the flags are referred to frequently. Convert these into bitfield entries. Change-Id: I6f47e31558439dfd343ec7f856d04480366a1237 Reviewed-on: https://code.wireshark.org/review/12511 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-09Call the dumper routine to finish write a file the "finish" routine.Guy Harris1-3/+3
It doesn't actually *close* any handle, so it's best called a "finish" routine rather than a "close" routine. In libwiretap modules, don't bother setting the finish routine pointer to null - it's already initialized to null (it's probably best not to require modules to set it). Change-Id: I19554f3fb826db495f17b36600ae36222cbc21b0 Reviewed-on: https://code.wireshark.org/review/11659 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-25Clean up 802.11 radio information handling.Guy Harris1-0/+1
Have a field that holds the PHY type but nothing else. Have a union with structures holding PHY-type-specific information, as a bunch of attributes are PHY-specific. If we have a channel and band, but don't have the frequency, attempt to calculate the frequency, and add that to the radio information if we succeed. If we have the frequency, but don't have the channel, attempt to calculate the channel, and add that to the radio information if we succeed. Handle FHSS information, 11a "half/quarter-clocked" and turbo information, 11g normal vs. Super G, additional 11n and 11ac information, and the "short preamble" flag for 11b and 11g. Add a PHY type for 11 legacy DSSS and detect it if possible. Clean up the AVS dissector - make all fields wlancap. fields (if you want generic fields, use the wlan_radio. fields). Set more fields when writing out Commview Wi-Fi files. Change-Id: I691ac59f5e9e1a23779b56a65124049914b72e69 Reviewed-on: https://code.wireshark.org/review/9146 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-20Call the "802.11 radio information" dissector for radio headers.Guy Harris1-1/+2
Have dissectors of various forms of radio information headers in the packets fill in a struct ieee_802_11_phdr with radio information as appropriate, and call the "802.11 radio information" dissector rather than the raw 802.11 dissector. This means that the radio information can be found in a protocol-independent and encapsulation-independent form when you're looking at the packet; that information can be presented in a form somewhat easier to read than the raw metadata header format. It also enables having a single "radio information" tap that allows statistics to handle all different sorts of radio information encapsulation. In addition, it lets us clean up some of the arguments passed to the common 802.11 dissector routine, by having it pull that information from the struct ieee_802_11_phdr. Ensure that the right structure gets passed to that routine, and that all the appropriate parts of that structure are filled in. Rename the 802.11 radio protocol to "wlan_radio", rather than just "radio", as it's 802.11-specific. Give all its fields "wlan_radio." names rather than "wlan." names. Change-Id: I78d79afece0ce0cf5fc17293c1e29596413b31c8 Reviewed-on: https://code.wireshark.org/review/8992 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-20Have a common routine to convert FILETIME to nstime_t.Guy Harris1-42/+5
We had several copies of that code; put it into a filetime_to_nstime() routine in wsutil, and call that common routine instead. Change-Id: I1eb5579c36c129ff8d23f9212285ab3f63be0f43 Reviewed-on: https://code.wireshark.org/review/8142 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-07ieee80211.c: "IEEE 802.11 plus Network Monitor radio header" encap: Fix ↵Bill Meier1-3/+8
dissection Specifically: Management/Control frames saved by Microsoft Netmon (3.4?) with "IEEE 802.11 plus Network Monitor radio header" encapsulation may or may not be saved with an FCS. See Bug 11105. Fix: Use "check fcs" preference to specify whether Management & Control frames have an fcs for this encapsulation. Change-Id: Ibd0be7b4765c2df2b959cb2234aeed027266246b Reviewed-on: https://code.wireshark.org/review/7939 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-03Remove unnecessary includes from wiretap folderMartin Mathieson1-1/+0
Change-Id: I10d3057801673bc1c8ea78f144215869cc4b1851 Reviewed-on: https://code.wireshark.org/review/6217 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-01-02Add "Editor modelines"; Adjust whitespace as needed.Bill Meier1-0/+13
Change-Id: Ic5a5acb0f36d3aa144edbfb1ae71097b18426db4 Reviewed-on: https://code.wireshark.org/review/6216 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-18Rename WTAP_ERR_REC_TYPE_UNSUPPORTED to WTAP_ERR_UNWRITABLE_REC_TYPE.Guy Harris1-1/+1
That indicates that it's a problem specific to *writing* capture files; we've already converted some errors to that style, and added a new one in that style. Change-Id: I8268316fd8b1a9e301bf09ae970b4b1fbcb35c9d Reviewed-on: https://code.wireshark.org/review/5826 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18Handle "I can't map this for that file format" better.Guy Harris1-2/+2
For cases where record (meta)data is something that can't be written out in a particular file format, return WTAP_ERR_UNWRITABLE_REC_DATA along with an err_info string. Report (and free) that err_info string in cases where WTAP_ERR_UNWRITABLE_REC_DATA is returned. Clean up some other error reporting cases, and flag with an XXX some cases where we aren't reporting errors at all, while we're at it. Change-Id: I91d02093af0d42c24ec4634c2c773b30f3d39ab3 Reviewed-on: https://code.wireshark.org/review/5823 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-17Rename WTAP_ERR_UNSUPPORTED_FILE_TYPE to WTAP_ERR_UNWRITABLE_FILE_TYPE.Guy Harris1-3/+3
That makes it clearer what the problem is, and that it should only be returned by the dump code path, not by the read code path. Change-Id: I22d407efe3ae9fba7aa25f08f050317549866442 Reviewed-on: https://code.wireshark.org/review/5798 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-17Rename WTAP_ERR_UNSUPPORTED_ENCAP to WTAP_ERR_UNWRITABLE_ENCAP.Guy Harris1-3/+3
That makes it clearer what the problem is, and that it should only be returned by the dump code path, not by the read code path. Change-Id: Icc5c9cff43be6c073f0467607555fa7138c5d074 Reviewed-on: https://code.wireshark.org/review/5797 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-17Use WTAP_ERR_UNSUPPORTED for input file stuff we can't handle.Guy Harris1-4/+4
WTAP_ERR_UNSUPPORTED_ENCAP means "I can't *write* that particular encapsulation type to a file of this format", which mainly means "that file format simply can't handle packets of that type"; WTAP_ERR_UNSUPPORTED means "this file can't currently be supported by Wireshark, as there's some feature in the file - such as a file or per-packet encapsulation type - that we don't (yet) handle". Change-Id: I53cadf9913d20efb2bccb29f61877b71d53807be Reviewed-on: https://code.wireshark.org/review/5794 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-29Expand the 802.11 pseudo-header and support new radio metadata.Guy Harris1-0/+1
Add a set of presence bits, so we can indicate which bits of radio metadata we do and don't have. Fill in more radio metadata from capture files, and display it. (More to come.) Change-Id: Idea2c05442c74af17c14c4d5a8d8025ab27fbd15 Reviewed-on: https://code.wireshark.org/review/4987 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10Oops, missed one.Guy Harris1-1/+1
Change-Id: I0847846d50d6979f0f50a00438a834c7c7c2acc0 Reviewed-on: https://code.wireshark.org/review/4586 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-09Use an enum for the open-routine return value, as per Evan Huus's suggestion.Guy Harris1-13/+13
Clean up some things we ran across while making those changes. Change-Id: Ic0d8943d36e6e120d7af0a6148fad98015d1e83e Reviewed-on: https://code.wireshark.org/review/4581 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-07No need for WTAP_ERR_CANT_READ.Guy Harris1-6/+0
Unlike the standard I/O routines, the code we introduced that supports fast random seeking on gzipped files will always supply some specific error code for read errors, so we don't need WTAP_ERR_CANT_READ. Add WTAP_ERR_CANT_WRITE for writing, as we're still using the standard I/O routines for that. Set errno to WTAP_ERR_CANT_WRITE before calling fwrite() in wtap_dump_file_write(), so that it's used if fwrite() fails without setting errno. Change-Id: I6bf066a6838284a532737aa65fd0c9bb3639ad63 Reviewed-on: https://code.wireshark.org/review/4540 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-07Add some higher-level file-read APIs and use them.Guy Harris1-39/+9
Add wtap_read_bytes(), which takes a FILE_T, a pointer, a byte count, an error number pointer, and an error string pointer as arguments, and that treats a short read of any sort, including a read that returns 0 bytes, as a WTAP_ERR_SHORT_READ error, and that returns the error number and string through its last two arguments. Add wtap_read_bytes_or_eof(), which is similar, but that treats a read that returns 0 bytes as an EOF, supplying an error number of 0 as an EOF indication. Use those in file readers; that simplifies the code and makes it less likely that somebody will fail to supply the error number and error string on a file read error. Change-Id: Ia5dba2a6f81151e87b614461349d611cffc16210 Reviewed-on: https://code.wireshark.org/review/4512 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-28Make the time stamp resolution per-packet.Guy Harris1-2/+2
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-08-02Rename buffer_ routines to ws_buffer_ to avoid name collisions.Guy Harris1-1/+1
In particular, epan/wslua/lrexlib.c has its own buffer_ routines, causing some linker warnings on some platforms, as reported in bug 10332. (Not to be backported to 1.12, as that would change the API and ABI of libwsutil and libwiretap. We should also make the buffer_ routines in epan/wslua/lrexlib.c static, which should also address this problem, but the name change avoids other potential namespace collisions.) Change-Id: I1d42c7d1778c7e4c019deb2608d476c52001ce28 Reviewed-on: https://code.wireshark.org/review/3351 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-15Only one buffer.c, please.Guy Harris1-1/+1
Otherwise, if you link with both libwiretap and libfiletap, it's anybody's guess which one you get. That means you're wasting memory with two copies of its routines if they're identical, and means surprising behavior if they're not (which showed up when I was debugging a double-free crash - fixing libwiretap's buffer_free() didn't fix the problem, because Wireshark happened to be calling libfiletap' unfixed buffer_free()). There's nothing *tap-specific about Buffers, anyway, so it really belongs in wsutil. Change-Id: I91537e46917e91277981f8f3365a2c0873152870 Reviewed-on: https://code.wireshark.org/review/3066 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Fix more errors revealed by enum-to-integer conversion warnings.Guy Harris1-5/+5
Change-Id: Ib28af874cbac0623ed94e7558f3711e9a1b03a2d Reviewed-on: https://code.wireshark.org/review/2874 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Squelch a warning.Guy Harris1-1/+1
Change-Id: Id27a6447dba9b6eda07933139a3f07edd71c8fd6 Reviewed-on: https://code.wireshark.org/review/2872 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Pull the record processing into netmon_process_record().Guy Harris1-135/+126
That combines more common code from the read and seek-read code paths. Also, separate out the individual metadata record types, with a comment for each, to simplify the process of supporting some or all of them in the future. Change-Id: Ic8ded397d9550ec6013c1f5f138333b1ef5c37e5 Reviewed-on: https://code.wireshark.org/review/2869 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05Fix an error caught by enum-conversion warnings.Guy Harris1-1/+1
(Strong typing is for weak minds. Human minds are weak. Therefore, strong typing is for human minds.) Change-Id: I2a973b6168235d5d1c7f2a5f8ac79b97b963d846 Reviewed-on: https://code.wireshark.org/review/2863 Reviewed-by: Guy Harris <guy@alum.mit.edu>