summaryrefslogtreecommitdiff
path: root/epan/packet.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-17Simplify dissector_try_uint_new().Martin Kaiser1-34/+38
Exit straight away if there's no entry for our value in the dissector table. Change-Id: I2637b4f03cb852dca0a6993b9f63fdc15e8edc58 Reviewed-on: https://code.wireshark.org/review/21165 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-17Fix the description of dissector_try_uint_new().Martin Kaiser1-2/+2
We return the number of bytes consumed by the dissector. Change-Id: Icc22c9e033dfb11f230fb59cfb79932bc8c80548 Reviewed-on: https://code.wireshark.org/review/21164 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-04-17Rename some routines and structure members.Guy Harris1-12/+12
They deal with sets of hfids, which can belong to protocols as well as fields (I guess you could argue that a protocol is a field, but...). Change-Id: Ibd103cfa26427ead4ef54be89f1251908004cfae Reviewed-on: https://code.wireshark.org/review/21154 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12Prime the epan_dissect_t with postdissector wanted fields if necessary.Guy Harris1-0/+19
This makes sure that postdissectors that indicate that they need certain fields in the first pass will get them. While we're at it: Fix the field-fetching code in TRANSUM not to assume it got any instances of the field being fetched. Rename process_packet_first_pass() in sharkd to process_packet(), as it's the only routine in sharkd that processes packets. Rename process_packet() in tshark and tfshark to process_packet_single_pass(), as it's what's used if we're only doing one-pass analysis. Clean up comments and whitespace. Change-Id: I3769af952c66f5ca4b68002ad6213858ab9cab9b Reviewed-on: https://code.wireshark.org/review/21063 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12Add an API to let a postdissector specify fields whose values it needs.Guy Harris1-16/+68
Currently, this is only used to determine whether a protocol tree needs to be built on the first pass or not - if there are postdissectors that need fields, it does - but eventually we should be able to use it to prime the dissection to deliver those fields in cases where we don't need the *entire* protocol tree (rather than using a hack such as cooking up a fake tap with a fake filter to do that). Update MATE and TRANSUM to use it. Clean up code to check whether we need a protocol tree, and add comments before that code indicating, in each case, what the criteria are. The array of postdissectors includes a length, so we don't need to separately keep track of the number of postdissectors. Clean up indentation while we're at it. Change-Id: I71d4025848206d144bc54cc82941089a50e80ab7 Reviewed-on: https://code.wireshark.org/review/21029 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-10Convert conversation hash tables to use wmem.Michael Mann1-5/+0
Simplifies cleanup because wmem can handle the memory cleanup. Change-Id: Idc6a9bfe5f23c83b59a5278a64b9fb706862342d Reviewed-on: https://code.wireshark.org/review/20042 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-01-30Remove unused variable initialization.Stig Bjørlykke1-1/+1
Change-Id: I674afef24938f3b860171d87640a6228ee042e82 Reviewed-on: https://code.wireshark.org/review/19862 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-01-28Snort: add a preference to show alert in reassembled frameMartin Mathieson1-0/+17
Change-Id: Ia29d451857995b186c88193c9722ae156eb3f66d Reviewed-on: https://code.wireshark.org/review/19729 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-20packet: add post_dissectors cleanup.Dario Lombardo1-3/+5
Change-Id: I9924425f1754c151552f41e23d20c7d4e6f1bf29 Reviewed-on: https://code.wireshark.org/review/19696 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-19packet: clean shutdown routines.Dario Lombardo1-0/+1
Change-Id: I620c683d77c724181a506e10f9d06a3944878690 Reviewed-on: https://code.wireshark.org/review/19679 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-19epan: add shutdown function for dissectors.Dario Lombardo1-12/+22
Dissectors can register shutdown functions, that will be called just before program exit. Those function will free the memory allocated during the init function. Change-Id: Id88228af2cc916bfb316fe7b36d46499f6e4f8d4 Reviewed-on: https://code.wireshark.org/review/19282 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-01-19packet.c: use call_routine() for all listsMartin Kaiser1-18/+3
For running through the postseq cleanup and final registration lists, we can use the same dummy function call_routine() that is used for the init and the cleanup lists. We don't need our own copies. Change-Id: Ia1ea647d5831adda26dab86eceba8fcf704ce122 Reviewed-on: https://code.wireshark.org/review/19668 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-18packet: free postseq_cleanup_routines list.Dario Lombardo1-6/+7
Change-Id: Ic1972399b706407ce8f15a3e554f1304a36d1009 Reviewed-on: https://code.wireshark.org/review/19663 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-01-17packet: free init/cleanup functions lists.Dario Lombardo1-6/+8
Change-Id: Ia28ceef189f8fe16105da88c01e1a159d5029c0a Reviewed-on: https://code.wireshark.org/review/19655 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-01-07packet: fix memleak of "short_name" for heuristics dissectorsPeter Wu1-1/+3
Change-Id: I3b954e3623473899b6039f0ff572eb56defe14cc Fixes: v2.3.0rc0-1841-ga8b68205a4 ("packet: duplicate short_name to fix UAF in wslua") Reviewed-on: https://code.wireshark.org/review/19571 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07Convert range API to always use wmem memory.Michael Mann1-3/+2
This is mostly to address memory leaks in range preferences (the biggest user of range functionality) on shutdown. Now range preferences must use epan scoped memory when referencing internal preference structures to keep consistency. Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157 Reviewed-on: https://code.wireshark.org/review/19387 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-02Use g_slist_find_custom instead of g_slist_nth when just looking for item in ↵Michael Mann1-10/+12
list. Change-Id: Ida3c5d5826f0ca01a25052a67f1460ff4686008f Reviewed-on: https://code.wireshark.org/review/19513 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-31Add interface for "pinos" (Protocols in name only)Michael Mann1-2/+2
This is for dissectors that need distinguishing names either for registering multiple dissection functions in a single dissector table or for "internal" dissectors whose just need a name associated with the dissection function. Features like enable/disable are handled by the "parent" protocol. This avoids clutter in the "official" protocol list. Change-Id: I69e7d27d332ae85286f254e95e8d79920da7a9e2 Reviewed-on: https://code.wireshark.org/review/19464 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-21packet: duplicate short_name to fix UAF in wsluaPeter Wu1-3/+4
The "short_name" parameter of heur_dissector_add is defined as const (and was assumed to be a string literal). This was no longer the case though since a change in Lua where "short_name" is a dynamically allocated string. This "simple" fix clones the memory for internal use to avoid a heap-use-after-free when heur_dissector_delete tries to access "short_name". An alternative option is to make Proto_register_heuristic track the memory, but since there are multiple possible heuristics lists for a protocol, the Proto (struct _wslua_field_t) structure is not appropriate. A possible working alternative is to store the string into lua_heur_dissectors_table_ref (replacing the value (function) by a tuple {function,short_name}). Change-Id: I6c6b393f4d304dd847e864da6ad17b54c8cd80e2 Fixes: v2.3.0rc0-1474-g7f2a838922 ("lua: Allow proto:register_heuristic to be used on multiple list names") Reviewed-on: https://code.wireshark.org/review/19365 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Franklin Mathieu <snaipe@diacritic.io> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-15packet.c: add initializer.Dario Lombardo1-2/+2
As per glib manual, GSLists need to be NULL initialized. Change-Id: If78904b900f6ddd7a0afaf3a1c480ec7626f2027 Reviewed-on: https://code.wireshark.org/review/19281 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-24packet.c: split register_dissector into two separate functionsJoão Valverde1-11/+13
Allows for better code reuse. Change-Id: I0f929e2548cf60905285d62c1095f85565a1c147 Reviewed-on: https://code.wireshark.org/review/18439 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>
2016-10-24Remove some code duplication in packet.cJoão Valverde1-14/+13
Change-Id: I60d71e0e4e7f3c35bec33910ecf4230569a1718c Reviewed-on: https://code.wireshark.org/review/18438 Reviewed-by: João Valverde <j@v6e.pt>
2016-10-12Cleanup from adding Decode As TCP preferences.Michael Mann1-1/+1
1. Fix bug caught by scan build (module not read) 2. Remove range preference call that should have been part of original patch. Change-Id: I24b1fb253548bffddc4c8ebfc3ede666d8fd9dcd Reviewed-on: https://code.wireshark.org/review/18143 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-5/+154
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-29/+53
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-24call_heur_dissector_direct: do not trigger an assert if heuristic dissector ↵Pascal Quantin1-3/+3
rejects packet This can happen for example is the heuristics changed between the Wireshark version used to export PDUs, and the one used to open the file. Instead, call data dissector. Change-Id: I29f7754f883fd710c3557a610583ef988ca13e43 Reviewed-on: https://code.wireshark.org/review/17280 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-25Fix checkAPI.pl warnings about printfMichael Mann1-10/+11
Many of the complaints from checkAPI.pl for use of printf are when its embedded in an #ifdef and checkAPI isn't smart enough to figure that out. The other (non-ifdef) use is dumping internal structures (which is a type of debug functionality) Add a "ws_debug_printf" macro for printf to pacify the warnings. Change-Id: I63610e1adbbaf2feffb4ec9d4f817247d833f7fd Reviewed-on: https://code.wireshark.org/review/16623 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>
2016-07-16Allocate data sources using wmem.Gerald Combs1-14/+2
Use wmem_strdup + the pinfo pool instead of g_strdup. Change-Id: I11fbb5ce31b7139421c558ee65ca43c8d8e85900 Reviewed-on: https://code.wireshark.org/review/16445 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-12Handle dissectors that don't have names.Guy Harris1-2/+9
Dissector handles created with create_dissector_handle() don't have a name; report them as "(anonymous)" (there's no guarantee that the printf family of routines don't crash when a null pointer is provided to %s - the printf routines in at least some versions of Solaris *do* crash in that case). Change-Id: I561ff855a46eeb442299011d567f20751c5c6869 Reviewed-on: https://code.wireshark.org/review/16399 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-21As with dissector_add_uint(), so with dissector_add_{string,guid}.Guy Harris1-7/+17
Improve the error message for a null disssector handle. Fix indentation while we're at it. Change-Id: I1cb2f8ac52e56fc98f6b3ad981018f571e5a7bf0 Reviewed-on: https://code.wireshark.org/review/16060 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-21Slightly improve error message in case of initialization errors.Joerg Mayer1-3/+8
Change-Id: Icb5d4f0f3bc60970737abbf62044f4550e8d3ca3 Reviewed-on: https://code.wireshark.org/review/16059 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-06-15More Sysdig / system event support.Gerald Combs1-0/+4
Add REC_TYPE_SYSCALL to wiretap and use it for Sysdig events. Call the Sysdig event dissector from the frame dissector. Create a "syscall" protocol for system calls, but add "frame" items to it for now. Add the ability to write Sysdig events. This lets us merge packet capture and syscall capture files. Change-Id: I12774ec69c89d8e329b6130c67f29aade4e3d778 Reviewed-on: https://code.wireshark.org/review/15078 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-15Allow control of individual columns to be (un)writable.Michael Mann1-4/+4
Most protocols just want to limit COL_INFO or COL_PROTOCOL so give that level of granularity. Bug: 12144 Bug: 5117 Bug: 11144 Change-Id: I8de9b7d2c69e90d3fbfc0a52c2bd78c3de58e2f8 Reviewed-on: https://code.wireshark.org/review/15894 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-14packet.c: remove const compiler warning.Dario Lombardo1-6/+6
Change-Id: Ida9384dccb0e8bacbc9aad39515c3dae9c5ce563 Reviewed-on: https://code.wireshark.org/review/14768 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-16Enhance error printout if register_dissector_table() is called with wrongAndersBroman1-0/+1
type. Change-Id: I7af0d89441b9ab87e9ed8dd0d52ca7f6ad82b896 Reviewed-on: https://code.wireshark.org/review/15458 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-09CID 1215245, 1215247: NULL check for the param of proto_get_id()Martin Kaiser1-1/+1
Change-Id: Ie1bcbffdc0040bf25e32c763185befb0231f4173 Reviewed-on: https://code.wireshark.org/review/15320 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-17Improve the message for duplicate dissectors for a protocol.Guy Harris1-1/+5
Report the names for the dissectors as well as the protocol and dissector table name. Change-Id: I901b396a1310f0d98b68c9499038fe2f38498ee1 Reviewed-on: https://code.wireshark.org/review/14948 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-02Avoid UAF after deregister_dissectorPeter Wu1-18/+34
When deregister_dissector is called by Lua, the protocol was not property removed from the dependent dissectors list. Fix this and also duplicate the memory for keys and values since these strings might be dynamically allocated. Fixes a use-after-free after reloading Lua dissectors that use DissectorTable:add() and opening a new/closing an existing capture file. Change-Id: If2ae02f155e7ab8fc653c08003755897471f9be0 Reviewed-on: https://code.wireshark.org/review/14735 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-0/+5
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20Start work on API to generate protocol dependency tree.Michael Mann1-1/+112
Dissector and heuristic tables now setup protocol dependencies. "Manual" dependencies in separate patch. Ping-Bug: 1402 Change-Id: I8da1239306de8676dcb05f8807914376816fc44f Reviewed-on: https://code.wireshark.org/review/14447 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-3/+11
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-13Lua: Remove heur dissectors when reload Lua pluginsStig Bjørlykke1-2/+3
When reloading Lua plugins all registered heuristic dissectors must be removed. Bug: 12251 Change-Id: Ib7da6df347fb9294f5394ae531b582bf6d2730bb Reviewed-on: https://code.wireshark.org/review/14429 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-26Add free_address_wmem(), fix warnings [-Wcast-qual]João Valverde1-30/+30
Try to improve address API and also fix some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Second try, now passing test suite. Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f Reviewed-on: https://code.wireshark.org/review/13946 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-16const gpointer -> gconstpointerJoão Valverde1-6/+6
'const gpointer' is the same as 'void *const'. Replace with gconstpointer where straightforward (assuming that was the intent) and use gpointer everywhere else for clarity (that does not change *API* constness contract; it just means a variable is not declared immutable inside the called funtion). Change-Id: Iad2ef13205bfb4ff0056b2bce056353b58942267 Reviewed-on: https://code.wireshark.org/review/13945 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-08Revert "Add free_address_wmem() and other extensions to address API"João Valverde1-30/+30
This reverts commit 13ec77a9fc3af3b0b502820d0b55796c89997896. This commit introduces a segmentation fault for Lua code (uncovered by the test suite). Change-Id: Ibc273d1915cda9632697b9f138f0ae104d3fb65e Reviewed-on: https://code.wireshark.org/review/13813 Reviewed-by: João Valverde <j@v6e.pt>
2016-02-07Add free_address_wmem() and other extensions to address APIJoão Valverde1-30/+30
Try to improve 'address' API (to be easier/safer) and also avoid some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Change-Id: I7456516b12c67620ceadac447907c12f5905bd49 Reviewed-on: https://code.wireshark.org/review/13463 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>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-1/+2
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23Set the pinfo time stamps based on the frame_data time stamps.Guy Harris1-2/+2
That takes into account any time-shifting that's been done. Change-Id: Ib4c01e7b055f5ac2f1111bcbe946c6094dcb70ae Reviewed-on: https://code.wireshark.org/review/13502 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23Add more fields to packet_info structure and use them.Guy Harris1-2/+8
Add fields for the absolute time stamp (and another field for a presence flag for the absolute time stamp) and the packet encapsulation for the packet. This lets us remove the field for the packet encapsulation in the frame_data structure; do so. Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39 Reviewed-on: https://code.wireshark.org/review/13499 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-14Rename new_dissector_t to dissector_t.Guy Harris1-4/+4
There are no longer any "old" dissectors, so "new_" is redundant. Change-Id: I5fee51228c2a8562166f5991e1f30c2c697e45c8 Reviewed-on: https://code.wireshark.org/review/13273 Reviewed-by: Guy Harris <guy@alum.mit.edu>