aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/nettrace_3gpp_32_423.c
AgeCommit message (Collapse)AuthorFilesLines
2022-09-10Dissector names are not protocol names.Guy Harris1-1/+1
A given protocol's packet format may depend, for example, on which lower-level protocol is transporting the protocol in question. For example, protocols that run atop both byte-stream protocols such as TCP and TLS, and packet-oriented protocols such as UDP or DTLS, might begin the packet with a length when running atop a byte-stream protocol, to indicate where this packet ends and the next packet begins in the byte stream, but not do so when running atop a packet-oriented protocol. Dissectors can handle this in various ways: For example, the dissector could attempt to determine the protocol over which the packet was transported. Unfortunately, many of those mechanisms do so by fetching data from the packet_info structure, and many items in that structure act as global variables, so that, for example, if there are two two PDUs for protocol A inside a TCP segment, and the first protocol for PDU A contains a PDU for protocol B, and protocol B's dissector, or a dissector it calls, modifies the information in the packet_info structure so that it no longer indicates that the parent protocol is TCP, the second PDU for protocol A might not be correctly dissected. Another such mechanism is to query the previous element in the layers structure of the packet_info structure, which is a list of protocol IDs. Unfortunately, that is not a list of earlier protocols in the protocol stack, it's a list of earlier protocols in the dissection, which means that, in the above example, when the second PDU for protocol A is dissected, the list is {...,TCP,A,B,...,A}, which means that the previous element in the list is not TCP, so, again, the second PDU for protocol A will not be correctly dissected. An alternative is to have multiple dissectors for the same protocol, with the part of the protocol that's independent of the protocol transporting the PDU being dissected by common code. Protocol B might have an "over a byte-stream transport" dissector and an "over a packet transport" dissector, with the first dissector being registered for use over TCP and TLS and the other dissector being registered for use over packet protocols. This mechanism, unlike the other mechanisms, is not dependent on information in the packet_info structure that might be affected by dissectors other than the one for the protocol that transports protocol B. Furthermore, in a LINKTYPE_WIRESHARK_UPPER_PDU pcap or pcapng packet for protocol B, there might not be any information to indicate the protocol that transports protocol B, so there would have to be separate dissectors for protocol B, with separate names, so that a tag giving the protocol name would differ for B-over-byte-stream and B-over-packets. So: We rename EXP_PDU_TAG_PROTO_NAME and EXP_PDU_TAG_HEUR_PROTO_NAME to EXP_PDU_TAG_DISSECTOR_NAME and EXP_PDU_TAG_HEUR_DISSECTOR_NAME, to emphasize that they are *not* protocol names, they are dissector names (which has always been the case - if there's a protocol with that name, but no dissector with that name, Wireshark will not be able to handle the packet, as it will try to look up a dissector given that name and fail). We fix that exported PDU dissector to refer to those tags as dissector names, not protocol names. We update documentation to refer to them as DISSECTOR_NAME tags, not PROTO_NAME tags. (If there is any documentation for this outside the Wireshark source, it should be updated as well.) We add comments for calls to dissector_handle_get_dissector_name() where the dissector name is shown to the user, to indicate that it might be that the protocol name should be used. We update the TLS and DTLS dissectors to show the encapsulated protocol as the string returned by dissector_handle_get_long_name(); as the default is "Application Data", it appeaers that a descriptive name, rather than a short API name, should be used. (We continue to use the dissector name in debugging messages, to indicate which dissector was called.)
2021-12-19Replace g_strdup_printf() with ws_strdup_printf()João Valverde1-7/+7
Use macros from inttypes.h.
2021-12-01nstime: Support ISO 8601 basic formatJohn Thacker1-1/+1
Add support in iso8601_to_nstime for the ISO 8601 Basic date/time format that lacks the - and : separators.
2021-09-06nettrace_3gpp (wiretap): Fix Dead Store found by Clang AnalyzerAlexis La Goutte1-3/+1
nettrace_3gpp_32_423.c:256:2: warning: Value stored to 'prev_pos' is never read [deadcode.DeadStores] nettrace_3gpp_32_423.c:295:2: warning: Value stored to 'next_msg_pos' is never read [deadcode.DeadStores] nettrace_3gpp_32_423.c:487:4: warning: Value stored to 'port_type_defined' is never read [deadcode.DeadStores]
2021-08-29wiretap: always allocate a block for a record.Guy Harris1-0/+1
Without that, you could add a comment to a record in a file format the reading code for which doesn't allocate blocks, but the comment doesn't get saved, as there's no block in which to save the comment option. This simplifies some code paths, as we're either using the record's modified block or we're using the block as read from the file, there's no third possibility. If we attempt to read a record, and we get an error, and a block was allocated for the record, unreference it, so the individual file readers don't have to worry about it.
2021-08-20Move LINKTYPE_WIRESHARK_UPPER_PDU definitions to a separate header.Guy Harris1-6/+6
Have wsutil/exported_pdu_tlvs.h define the LINKTYPE_WIRESHARK_UPPER_PDU TLV type and length values, as well as the port type values written to files in EXP_PDU_TAG_PORT_TYPE TLVs. Update the comment that describes the LINKTYPE_WIRESHARK_UPPER_PDU TLVs to more completely and correctly reflect reality (it was moved from epan/exported_pdu.h to wsutil/exported_pdu_tlvs.h). Rename those port type values from OLD_PT_ to EXP_PDU_PT_; there is nothing "old" about them - yes, they originally had the same numerical values as the PT_ enum values in libwireshark, but that's no longer the case, and the two are now defined independently. Rename routines that map between libwireshark PT_ values and EXP_PDU_PT_ values to remove "old" from the name while we're at it. Don't include epan/exported_pdu.h if we only need the LINKTYPE_WIRESHARK_UPPER_PDU definitions - just include wsutil/exported_pdu_tlvs.h. In extcap/udpdump.c, include wsutil/exported_pdu_tlvs.h rather than defining the TLV types ourselves.
2021-08-20Use the wsutil/pint.h functions to fill in "exported PDU" headers.Guy Harris1-60/+53
That makes the code cleaner, including making it clearer that the fields in those headers are big-endian.
2021-07-25nettrace 3GPP 32.423: move the name related code together.Guy Harris1-1/+1
Initialize name_str right before we fill it in if the name is present, and note what we're doing, to make it a bit clearer what the initializing code is doing.
2021-07-25libwiretap: Avoid using uninit variableMoshe Kaplan1-0/+2
Within wiretap/nettrace_3gpp_32_423.c, set the first byte of the buffer to a null byte to avoid potentially accessing uninitiliazed memory. Fixes Coverity 1471685.
2021-06-06Replace g_assert() with ws_assert() in placesJoão Valverde1-1/+2
2021-05-29wiretap: clean up WTAP_ERR_BAD_FILE error messages.Guy Harris1-7/+7
Consistently give a file type name at the beginning of the message.
2021-04-30Cast away the return value of g_strlcpy() and g_strlcat().Guy Harris1-7/+7
Most of the time, the return value tells us nothing useful, as we've already decided that we're perfectly willing to live with string truncation. Hopefully this keeps Coverity from whining that those routines could return an error code (NARRATOR: They don't) and thus that we're ignoring the possibility of failure (as indicated, we've already decided that we can live with string truncation, so truncation is *NOT* a failure).
2021-03-15Remove unnecessary includes of wiretap/pcap-encap.h.Guy Harris1-1/+0
2021-03-15Remove unnecessary inclues of wiretap/pcapng.h.Guy Harris1-1/+0
2021-02-23wiretap: rename wtap_register_file_type_subtypes().Guy Harris1-1/+1
It only registers one file type/subtype, so rename it to wtap_register_file_type_subtype(). That will also force plugins to be recompiled; that will produce compile errors for some plugins that didn't change to match the new contents of the file_type_subtype_info structure. Also check to make sure that the registered file type/subtype supports at least one type of block; a file type/subtype that doesn't return *any* blocks and doesn't permit *any* block types to be written is not very useful. That should also catch most if not all other plugins that didn't change to match the new contents of the file_type_subtype_info structure. Don't make errors registering a file type/subtype fatal; just complain, don't register the bogus file type/subtype, and drive on.
2021-02-21wiretap: have file handlers advertise blocks and options supported.Guy Harris1-1/+8
Instead of a "supports name resolution" Boolean and bitflags for types of comments supported, provide a list of block types that the file type/subtype supports, with each block type having a list of options supported. Indicate whether "supported" means "one instance" or "multiple instances". "Supports" doesn't just mean "can be written", it also means "could be read". Rename WTAP_BLOCK_IF_DESCRIPTION to WTAP_BLOCK_IF_ID_AND_INFO, to indicate that it provides, in addition to information about the interface, an ID (implicitly, in pcapng files, by its ordinal number) that is associated with every packet in the file. Emphasize that in comments - just because your capture file format can list the interfaces on which a capture was done, that doesn't mean it supports this; it doesn't do so if the file doesn't indicate, for every packet, on which of those interfaces it was captured (I'm looking at *you*, Microsoft Network Monitor...). Use APIs to query that information to do what the "does this file type/subtype support name resolution information", "does this file type/subtype support all of these comment types", and "does this file type/subtype support - and require - interface IDs" APIs did. Provide backwards compatibility for Lua. This allows us to eliminate the WTAP_FILE_TYPE_SUBTYPE_ values for IBM's iptrace; do so.
2021-02-21Some more spelling fixes.Martin Mathieson1-1/+1
Also add more words to dictionary file.
2021-02-17wiretap: more work on file type/subtypes.Guy Harris1-4/+8
Provide a wiretap routine to get an array of all savable file type/subtypes, sorted with pcap and pcapng at the top, followed by the other types, sorted either by the name or the description. Use that routine to list options for the -F flag for various commands Rename wtap_get_savable_file_types_subtypes() to wtap_get_savable_file_types_subtypes_for_file(), to indicate that it provides an array of all file type/subtypes in which a given file can be saved. Have it sort all types, other than the default type/subtype and, if there is one, the "other" type (both of which are put at the top), by the name or the description. Don't allow wtap_register_file_type_subtypes() to override any existing registrations; have them always register a new type. In that routine, if there are any emply slots in the table, due to an entry being unregistered, use it rather than allocating a new slot. Don't allow unregistration of built-in types. Rename the "dump open table" to the "file type/subtype table", as it has entries for all types/subtypes, even if we can't write them. Initialize that table in a routine that pre-allocates the GArray before filling it with built-in types/subtypes, so it doesn't keep getting reallocated. Get rid of wtap_num_file_types_subtypes - it's just a copy of the size of the GArray. Don't have wtap_file_type_subtype_description() crash if handed an file type/subtype that isn't a valid array index - just return NULL, as we do with wtap_file_type_subtype_name(). In wtap_name_to_file_type_subtype(), don't use WTAP_FILE_TYPE_SUBTYPE_ names for the backwards-compatibility names - map those names to the current names, and then look them up. This reduces the number of uses of hardwired WTAP_FILE_TYPE_SUBTYPE_ values. Clean up the type of wtap_module_count - it has no need to be a gulong. Have built-in wiretap file handlers register names to be used for their file type/subtypes, rather than building the table in init.lua. Add a new Lua C function get_wtap_filetypes() to construct the wtap_filetypes table, based on the registered names, and use it in init.lua. Add a #define WSLUA_INTERNAL_FUNCTION to register functions intended only for internal use in init.lua, so they can be made available from Lua without being documented. Get rid of WTAP_NUM_FILE_TYPES_SUBTYPES - most code has no need to use it, as it can just request arrays of types, and the space of type/subtype codes can be sparse due to registration in any case, so code has to be careful using it. wtap_get_num_file_types_subtypes() is no longer used, so remove it. It returns the number of elements in the file type/subtype array, which is not necessarily the name of known file type/subtypes, as there may have been some deregistered types, and those types do *not* get removed from the array, they just get cleared so that they're available for future allocation (we don't want the indices of any registered types to changes if another type is deregistered, as those indicates are the type/subtype values, so we can't shrink the array). Clean up white space and remove some comments that shouldn't have been added.
2021-02-14wiretap: register most built-in file types from its module.Guy Harris1-1/+19
Remove most of the built-in file types from the table in wiretap/file_access.c and, instead, have the file types register themselves, using wtap_register_file_type_subtypes(). This reduces the source code changes needed to add a new file type from three (add the handler, add the file type to the table in file_access.c, add a #define for the file type in wiretap/wtap.h) to one (add the handler). (It also requires adding the handler's source file to wiretap/CMakeLists.txt, but that's required in both cases.) A few remain because the WTAP_FILE_TYPE_SUBTYPE_ #define is used elsewhere; that needs to be fixed. Fix the wiretap/CMakefile.txt file to scan k12text.l, as that now contains a registration routine. In the process, avoid scanning files that don't implement a file type and won't ever have a registration routine. Add a Lua routine to fetch the total number of file types; we use that in some code to construct the wtap_filetypes table, which we need to do in order to continue to have all the values that used to come from the WTAP_FILE_TYPE_SUBTYPE_ types. While we're at it, add modelines to a file that lacked them.
2021-01-08Add iso8601_to_nstime() for editcap and nettraceDavid Perry1-120/+1
This adds a function to parse a string date-time in ISO 8601 format into a `nstime_t` structure. It's based on code from epan/tvbuff.c and wiretap/nettrace_3gpp_32_423.c and meant to eventually replace both. (Currently only replaces the latter.) Since most of Wireshark expects ISO 8601 date-times to fit a fairly strict pattern, iso8601_to_nstime() currently rejects date-times without separators between the components, even though ISO 8601 actually permits this. This could be revisited later. Also uses iso8601_to_nstime in editcap to parse the -A/-B options, thus allowing the user to specify a time zone if desired. (See #17110)
2021-01-04Initial refactor of nettrace reader (#17009)David Perry1-946/+692
Old behaviour is to read the entire file into memory at once; provide the XML tree as the first packet; and then individual `<msg>` elements as subsequent packets. It did this by writing to a temporary pcapng file. This change causes the XML file to only be read a chunk at a time (and be read directly, not through an intermediate pcapng). This means much larger files can be loaded, at the cost of no longer showing the raw XML as the first packet. This is not a loss because the file can be loaded in MIME Files Format (or a text editor) to see the XML. Much of the logic from the old functions `create_temp_pcapng_file()` and `write_packet_data()` has been relocated into the new function `nettrace_msg_to_packet()`, and is used to directly generate packet data for wiretap instead of writing it to a temporary file. Also includes some initial "code smell" fixes: - Removed some duplicate `#define`s from epan/exported_pdu.h - Replaces some magic numbers with macros from epan/exported_pdu.h - Replaces other magic numbers with the CLEN() macro to make it easier to see (and debug) where sizes/offsets come from - Use `g_strstr_len()` instead of `strstr()` to remove the need to insert string terminators - Uses direct pointer math instead of indexing into a byte array This compiles and runs, and seems to produce the same results as the old reader (except for the XML packet). Consider it a proof of concept; it needs further revision before being review-ready.
2020-11-02Nettrace: correct conversion from ISO 8601 to time stampAndre Luyer1-84/+52
A nettrace 3gpp capture contains the 'beginTime' in ISO 8601 format. This patch corrects the conversion for the following steps: - the UTC offset must be subtracted from the given time, - given time must be converted to UTC time when an offset is provided (localtime otherwise) - sub-seconds conversion fixed (i.e. .0012 was converted to .12). Closes #16888
2020-10-14Have WTAP_ERR_INTERNAL include an err_info string giving details.Guy Harris1-19/+5
That way, users won't just see "You got an internal error", the details will be given, so they can report them in a bug.
2020-10-11Fix many spelling errorsРоман Донченко1-5/+5
2020-10-03Nettrace: Fix fix to calculation of changetimeGuy Harris1-1/+1
A long time ago, in a galaxy far far away, C had arithmetic/logical- plus-assignment operators, so that a = a {op} x; could be written as a ={op} x; Unfortunately, if {op} is -, that meant that you could have, for example: a =- 17; which could be interpreted as a = -17; so they changed the operators to be a {op}= x; I.e., if you want to subtract 1000 from a variable, do elapsed_ms -= 1000; not elapsed_ms =- 1000;
2020-10-03Nettrace: Fix calculation of changetimeAnders Broman1-11/+17
Closes #16869 (closed)
2020-07-06Nettrace: Try to fix -Wpointer-sign warnings.Anders Broman1-9/+9
Change-Id: Ib2fe089939513f2fa32235312cdc70c9148cdfc3 Reviewed-on: https://code.wireshark.org/review/37723 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-15nettrace_3gpp_32_423(wiretap): Fix Dead StoreAlexis La Goutte1-4/+1
Fix dead store (Dead assignement/Dead increment) Warning found by Clang Change-Id: I6316d82fec8ee87f56cabe27e269cc7ef98cedc8 Reviewed-on: https://code.wireshark.org/review/36842 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-14wiretap: don't use memset where possible.Dario Lombardo1-3/+1
Change-Id: Id74764242ba13fb4ed58299a475096a64e5c6b5b Reviewed-on: https://code.wireshark.org/review/36838 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-28nettrace_3gpp_32_423: Improve parsing.Anders Broman1-32/+33
Change-Id: I4593154a7791355afff76f7ca823c7f786605490 Reviewed-on: https://code.wireshark.org/review/36224 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-20Use g_file_open_tmp within create_tempfileMichael Mann1-3/+6
Much better to use a known library than create it ourselves. Also remove get_tempfile_path as it's not used. Bug: 15992 Change-Id: I17b9bd879e8bdb540f79db83c6c138f8ee724764 Reviewed-on: https://code.wireshark.org/review/34420 Reviewed-by: Tomasz Moń <desowin@gmail.com> Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-28HTTPS In Even More Places, update some links.Guy Harris1-1/+1
Fall back on the Wayback Machine for some links. Change-Id: I6a44a2caaeb4fa521c2f08196e7c36069e3bb842 Reviewed-on: https://code.wireshark.org/review/34103 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-173gpp_32_423: Fix dissection of changeTime.Anders Broman1-13/+15
Change-Id: I8d86f92a918044763a02d0ba9856ea97c3937bf1 Reviewed-on: https://code.wireshark.org/review/33240 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-05Have wtap_read() fill in a wtap_rec and Buffer.Guy Harris1-34/+4
That makes it - and the routines that implement it - work more like the seek-read routine. Change-Id: I0cace2d0e4c9ebfc21ac98fd1af1ec70f60a240d Reviewed-on: https://code.wireshark.org/review/32727 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-25wiretap: fix memleaks with wtap_rec::opt_commentPeter Wu1-0/+2
The memory ownership of wtap_rec::opt_comment was not clear. Users of wtap were leaking memory (editcap.c). wtap readers were not sure about freeing old comments (erf) or simply ignored memleaks (pcapng). To fix this, ensure opt_comment is owned by wtap_rec and free it with wtap_rec_cleanup. The erf issue was already addressed since cf_get_packet_comment properly duplicates wth.opt_comment memory. - wtap file formats (readers): - Should allocate memory for new comments. - Should free a comment from an earlier read before writing a new one. - Users of wth: - Can only assume that opt_comment remains valid until the next read. - Can assume that wtap_dump does not modify the comment. - For random access (wtap_seek_read): should call wtap_rec_cleanup to free the comment. The test_tshark_z_expert_comment and test_text2pcap_sip_pcapng tests now pass when built with ASAN. This change was created by carefully looking at all users opt "opt_comment" and cf_get_packet_comment. Thanks to Vasil Velichkov for an initial patch which helped validating this version. Bug: 7515 Change-Id: If3152d1391e7e0d9860f04f3bc2ec41a1f6cc54b Reviewed-on: https://code.wireshark.org/review/31713 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-23nettrace: fix potential buffer overflow in time parsingPeter Wu1-10/+8
sscanf can consume less than 19 characters (e.g. given time format 1-1-1T1:1:1), be sure to reject such input. Fix some dead store warning while at it. Change-Id: I6148599048f1e89ea7aafdbdd6450574a97b22fd Fixes: v2.9.1rc0-372-gd38f6025b0 ("nettrace: Handle beginTime with fractions of seconds.") Reviewed-on: https://code.wireshark.org/review/31699 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-14nettrace: Handle beginTime with fractions of seconds.Anders Broman1-36/+68
Change-Id: If12f5430e816a373c084996a6e55846ce825a4de Reviewed-on: https://code.wireshark.org/review/31539 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-12wiretap: remove dependency on version_infoPeter Wu1-3/+3
Avoid including the precise version string in the pcapng file that is created for 3GPP TS 32.423 formats. This avoids unnecessarily relinking of applications depending on wiretap. Change-Id: Ida1f3c0c998d811cbf85734bd83438bcbfc39cf4 Reviewed-on: https://code.wireshark.org/review/31513 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-11nettrace: Fix missing tag length for IPV4_DST.Anders Broman1-7/+14
Change-Id: I00564adaef2922ff991887f0ee5c04a3c7307019 Reviewed-on: https://code.wireshark.org/review/31488 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-06nettrace_3gpp_32_423: Fix Dead Store (Dead assignement/Dead increment) ↵Alexis La Goutte1-8/+1
Warning found by Clang Change-Id: I9f59b5ae6fe34d124b6930fa759c7c76c38aa213 Reviewed-on: https://code.wireshark.org/review/31412 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-13Move more version-info-related stuff to version_info.c.Guy Harris1-1/+1
Have a ws_init_version_info() routine that, given an application name string: constructs the app-name-and-version-information string, and saves it; adds the initial crash information on platforms that support it, and saves it. Have show_version() use the saved information and take no arguments. Add a show_help_header() routine to print the header for --help command-line options, given a description of the application; it prints the application name and version information, the description, and the "See {wireshark.org URL}" line. Use those routines in various places, including providing the "application name" string in pcapng SHBs. Change-Id: I0042a8fcc91aa919ad5c381a8b8674a007ce66df Reviewed-on: https://code.wireshark.org/review/31029 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-20nettrace: Put address parsing in a separate routine.Anders Broman1-121/+104
Change-Id: Ia223585986c6c8ad51fba36aa16c5780fc372f70 Reviewed-on: https://code.wireshark.org/review/30714 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-16nettrace: Handle failure to parse IPv6.Anders Broman1-3/+6
Reading of Address needs refacoring. Change-Id: Icca094a50bda4314bda72005bfc0d722e3d185d2 Reviewed-on: https://code.wireshark.org/review/30672 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-16nettrace: fix var init.Dario Lombardo1-1/+3
Error: ../wiretap/nettrace_3gpp_32_423.c:745:47: error: missing field 'src_ip' initializer [-Werror,-Wmissing-field-initializers] exported_pdu_info_t exported_pdu_info = { 0 }; ^ 1 error generated. ninja: build stopped: subcommand failed. Change-Id: I6c083b474854ea062f0a1c9f94e83af83574fc91 Reviewed-on: https://code.wireshark.org/review/30661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-16Use an enum for compression types in various interfaces.Guy Harris1-1/+2
This: 1) means that we don't have to flag the compression argument with a comment to indicate what it means (FALSE doesn't obviously say "not compressed", WTAP_UNCOMPRESSED does); 2) leaves space in the interfaces in question for additional compression types. (No, this is not part 1 of an implementation of additional compression types, it's just an API cleanup. Implementing additional compression types involves significant work in libwiretap, as well as UI changes to replace "compress the file" checkboxes with something to indicate *how* to compress the file, or to always use some other form of compression). Change-Id: I1d23dc720be10158e6b34f97baa247ba8a537abf Reviewed-on: https://code.wireshark.org/review/30660 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-16Use the dump parameters structure for non-pcapng-specific stuff.Guy Harris1-3/+5
Use it for all the per-file information, including the per-file link-layer type and the per-file snapshot length. Change-Id: Id75687c7faa6418a2bfcf7f8198206a9f95db629 Reviewed-on: https://code.wireshark.org/review/30616 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-11-15nettrace: Parse IPv6 addresses.Anders Broman1-50/+137
Change-Id: Iad583c39605ed2dd7a1c64f3729500c6b8a31fd3 Reviewed-on: https://code.wireshark.org/review/30650 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-14nettrace_3gpp_32_423: Don't crash on error and improve error output.Anders Broman1-1/+18
Change-Id: I4ea7ccf51321d6ce316456bde24aa37880ea52ed Reviewed-on: https://code.wireshark.org/review/30627 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-13Don't have _ng versions of the dumper open routines.Guy Harris1-2/+2
Have the routines always take a parameters pointer; pass either null or a pointer to an initialized-to-nothing structure in cases where we were calling the non-_ng versions. Change-Id: I23b779d87f3fbd29306ebe1df568852be113d3b2 Reviewed-on: https://code.wireshark.org/review/30590 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>