aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap_opttypes.h
AgeCommit message (Collapse)AuthorFilesLines
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-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>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-4/+4
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-02-20wtap_opttypes(.h): fix commas at the end of enumerator lists are a C++11 ↵Alexis La Goutte1-1/+1
extension [-Wc++11-extensions] Change-Id: Ie7f67510ea948fb72b57fe08d9f95d135c5855a5 Reviewed-on: https://code.wireshark.org/review/20194 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>
2017-02-14wiretap: add cleanup routine.Dario Lombardo1-0/+4
The cleanup routine has been added to exit section of the applications. Those which required a exit restyle have been patched as well. Change-Id: I3a8787f0718ac7fef00dc58176869c7510fda7b1 Reviewed-on: https://code.wireshark.org/review/19949 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-07-16Comment cleanups.Guy Harris1-9/+9
Change-Id: I995ba14cbd9bbe2c01b0770c16095084895498db Reviewed-on: https://code.wireshark.org/review/16486 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-16Add APIs to remove option instances from blocks.Guy Harris1-0/+22
That will allow deletion of comments, stripping of options when sanitizing captures, etc.. Change-Id: I9667ba2ccf4e548ff3b7d500796b260a437bcea0 Reviewed-on: https://code.wireshark.org/review/16485 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-15Update comments, give option numbers in decimal.Guy Harris1-27/+27
The pcapng spec gives option numbers in decimal, not hex. Get rid of the "XXX if not available" comments - if an option isn't present in a block, it's not present, and doesn't have *any* value. Change-Id: I1bf0c9a5aaad7dfadf9248e22b67e172625bdd0d Reviewed-on: https://code.wireshark.org/review/16480 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-14Redo the block options APIs.Guy Harris1-76/+218
A block can have zero or more instances of a given option. We distinguish between "one instance only" options, where a block can have zero or one instance, and "multiple instances allowed" options, where a block can have zero or more instances. For "one instance only" options: "add" routines add an instance if there isn't one already and fail if there is; "set" routines add an instance if there isn't one already and change the value of the existing instance if there is one; "set nth" routines fail; "get" routines return the value of the instance if there is one and fail if there isn't; "get nth" routines fail. For "multiple instances allowed" options: "add" routines add an instance; "set" routines fail; "set nth" routines set the value of the nth instance if there is one and fail otherwise; "get" routines fail; "get nth" routines get the value if the nth instance if there is one and fail otherwise. Rename "optionblock" to just "block"; it describes the contents of a block, including both mandatory items and options. Add some support for NRB options, including IPv4 and IPv6 option types. Change-Id: Iad184f668626c3d1498b2ed00c7f1672e4abf52e Reviewed-on: https://code.wireshark.org/review/16444 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-16randpktdump: fix a crash.Dario Lombardo1-1/+1
Randpktdump requires the init the wtap opttypes. Fixed making the init function public and calling it. Bug: 12539 Change-Id: I02585c41012deacff1526b51ed09ab555cbfc8ce Reviewed-on: https://code.wireshark.org/review/15951 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-16Export wtap_optionblock_copy_options() symbolPascal Quantin1-1/+1
It can be useful for wiretap plugins Change-Id: Ic56e4357ba3bfcef30d13615efc1361399c3133e Reviewed-on: https://code.wireshark.org/review/15955 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-06Add a routine to get an array of all instances of a string option.Guy Harris1-0/+11
Use it for OPT_COMMENT in the SHB, as there may be ore than one instance of OPT_COMMENT in an SHB. Also, use wtap_optionblock_get_option_string for OPT_SHB_HARDWARE, OPT_SHB_OS, and OPT_SHB_USERAPPL; they're specified as "only one instance allowed". Change-Id: I23ad87e41e40b7ae1155e96c0523a6f8caad5204 Reviewed-on: https://code.wireshark.org/review/15750 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-06Directly use wtap_opttypes calls to fetch SHB options.Guy Harris1-0/+96
Don't put them in the summary structure; the summary routines should calculate summary statistics, not dig up every bit of information that *could* appear in a summary. Instead, have the GUI code call wtap_file_get_shb() to get the SHB information and call wtap_optionblock_get_option_string() to fetch the option values. Move the option code definitions into wtap_opttypes.h, as they're used by the API. Change-Id: Icef11f5fb30fdc3df1bb0208aae9ed0aebaf0182 Reviewed-on: https://code.wireshark.org/review/15748 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-01Add data structures necessary to support multiple Section Header blocks.Michael Mann1-0/+10
This doesn't try to use any data from multiple Section Header blocks, it just converts single Section Header block usage into a GArray, so the potential is there to then use/support multiple Section Header blocks within a file format (like pcapng) Change-Id: I6ad1f7b8daf4b1ad7ba0eb1ecf2e170421505486 Reviewed-on: https://code.wireshark.org/review/15636 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-05-30If routines return a wtap_opttype_return_val, declare them as doing so.Guy Harris1-38/+58
Also, improve the doxygen comments. Change-Id: I57929dfba23d926fd806ac001a5a3924bb636ae0 Reviewed-on: https://code.wireshark.org/review/15634 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-28Make wtap_optionblock_foreach_option public.Guy Harris1-1/+1
Change-Id: I99e448319669acfdb0ec3b96e8e1195ba4a1f4f9 Reviewed-on: https://code.wireshark.org/review/15594 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-26Remove write capabilities from wtap_optionblocks.Michael Mann1-31/+3
The write functionality was too PCAPNG-specific and the intention is to keep the option blocks as generic as possible. So moved the write functionality back to pcapng.c and added a wtap_opttype API to loop through all options in the block (wtap_optionblock_foreach_option) Change-Id: Iaf49126a1a3e2ed60ae02c52878ca22671dac335 Reviewed-on: https://code.wireshark.org/review/15525 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-05-22Add wtap_optionblock_set_option_string_formatMichael Mann1-1/+12
Also add a length parameter to wtap_optionblock_set_option_string Change-Id: I8c7bbc48aa96b5c2a91ab9a17980928d6894f1ee Reviewed-on: https://code.wireshark.org/review/15505 Reviewed-by: Anthony Coddington <anthony.coddington@endace.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-21Add ability to add custom block types.Michael Mann1-2/+11
Change-Id: I2d23148c6f8d847aacec1d25cb694793ec9bb84e Reviewed-on: https://code.wireshark.org/review/15504 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-03-06Improve wiretap block capabilities.Michael Mann1-83/+66
Make a more formal method for registering options within a block and do it all with a single function (wtap_optionblock_add_block). Add ability for block to be able to write itself, refactored out of pcapng.c. This was implemented for SHB, ISB, and IDB blocks. Name resolution (NRB), while possible, seemed a little messy for the moment. Change-Id: Ie855c8550c7c7d96cfc188c0cd90bfbc4d5f0ee8 Reviewed-on: https://code.wireshark.org/review/14357 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-03-03Refactor wiretap option block types into a registration system.Michael Mann1-1/+2
Also required mergecap to look for plugins to initialize wiretap option blocks. Change-Id: I4208d1028dd0f94f185393801d72025329266cb7 Reviewed-on: https://code.wireshark.org/review/14300 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-02-27wtap (opttypes.h): fix no newline at end of file [-Wnewline-eof]Alexis La Goutte1-1/+2
Change-Id: I5bdd42bce983cd874597f4675afe4c8b2790e0f6 Reviewed-on: https://code.wireshark.org/review/14196 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-23Making wiretap option blocks more generic.Michael Mann1-0/+250
This was inspired by https://code.wireshark.org/review/9729/, but takes it in a different direction where all options are put into an array, regardless of whether they are "standard" or "custom". It should be easier to add "custom" options in this design. Some, but not all blocks have been converted. Descriptions of some of the block options have been moved from wtap.h to pcapng.h as it seems to be the one that implements the description of the blocks. Also what could be added/refactored is registering block behavior. Change-Id: I3dffa38f0bb088f98749a4f97a3b7655baa4aa6a Reviewed-on: https://code.wireshark.org/review/13667 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>