Commit Graph

2417 Commits

Author SHA1 Message Date
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
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-13 02:51:18 +00:00
Birol Capa 50ddeaadf9 PROFINET: Don't display expert information when implicit AR is used.
According to specification:
Value(UUID): 00000000-0000-0000-0000-000000000000
Meaning: Reserved
Use: The value NIL indicates the usage of the implicit AR.

Change-Id: Iea807f14bf6da36700b778a1383ebd970aa105a5
Reviewed-on: https://code.wireshark.org/review/17951
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-10-12 03:45:38 +00:00
Michael Mann e8022a9c7b Profinet I/O: Sanity check number of I/O objects
Can prevent really long loops from fuzz testing.

Bug: 12851
Change-Id: I85e00af2c4753ce4c5bcb650a7df188d7f679c9a
Reviewed-on: https://code.wireshark.org/review/18136
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-10 13:11:29 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
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-10-08 02:44:53 +00:00
Birol Capa d2a59db2bb PROFINET: Add preliminary version of the Reporting System (RS) dissection.
The Reporting System (RS) ASE is composed of Observers and Event buffer queues.

Bug: 12959
Change-Id: Ibce2d607bffe9c04b24e8ccd5ef502307fbba7c6
Reviewed-on: https://code.wireshark.org/review/17965
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-10-03 17:44:23 +00:00
Peter Wu 534787e402 cmake: make WERROR_COMMON_FLAGS a normal string
Instead of checking for the boolean "FALSE", just set an empty string.
This avoids the need to check for WERROR_COMMON_FLAGS before using it.

The transformation is the same for all files, remove
"if (WERROR_COMMON_FLAGS)" and "endif()", reindent and add quotes (since
we have a string here and not a list).

Modelines have been added where missing.

Change-Id: I0ab05ae507c51fa77336d49a99a226399cc81b92
Reviewed-on: https://code.wireshark.org/review/17997
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
2016-09-30 20:08:02 +00:00
Birol Capa 48b641576c PROFINET: Fix variable may not have been initialized warning
The variable may not have been initialized.
To make code more readable and to avoid possible future mistakes
initialize the variables.

Change-Id: I0c5e78b6d625c87252a4c47e263a3d5c701f2674
Reviewed-on: https://code.wireshark.org/review/17962
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-09-29 03:55:03 +00:00
Birol Capa a88b7bc1a6 PROFINET: Fix switch statement has no default
A switch statement has no section labeled default.
To make the code more readable add the default statement with a good comment.

Change-Id: Iacd9b1520628e229baedc89277d07ffac2caf1b6
Reviewed-on: https://code.wireshark.org/review/17960
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-29 00:51:15 +00:00
Birol Capa 814477c32f PROFINET: Fix pointer variable 'fp' previously deallocated warning
'fp' pointer variable was freed or deleted in an earlier statement.

To make code more readable and to avoid possible future mistakes
make sure that developer sees this situation.

Change-Id: Ib5b9c4c32000adf05a30e094ebc98fe4bc4cfa52
Reviewed-on: https://code.wireshark.org/review/17961
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>
2016-09-29 00:49:57 +00:00
Birol Capa a3ce2336b2 PROFINET: Fix possibly passing a null pointer to function
A NULL pointer is possibly being passed to a function identified.

Change-Id: I87afb4fcd669451d94fecbcb827e7ff82d3e6740
Reviewed-on: https://code.wireshark.org/review/17950
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-09-28 18:14:14 +00:00
Peter Wu b6a2915d0d mate: fix Match edge cases, improve documentation
Use strcmp to sort AVPs in an AVPL and for matching instead of comparing
pointer addresses. Pointers can only be used for (in)equality, there is
no ordering in them. Matching of attributes however requires a better
ordering to know whether the operator (condition) or whether the operand
(data) can be skipped. Otherwise it is possible that condition (b)
randomly fails to match data (a,b).

User-visible changes (mainly edge cases):

 - Loose (a=1, a?) on data (a=0, a=1) would previously fail to return
   (a=0,a=1) because the a? condition is not tried for data a=0. Now it
   tries all compatible conditions for a data AVP.
 - Any Match condition like (a=1, a^1) would previously be treated the
   same as (a=1) while (a^1, a=1) would still be seen as (a^1, a=1). The
   first case is now fixed to match (a=1, a^1). (Via a fix in insert_avp
   to ensure that (a=1) is not considered the same as (a^1).)
 - Every (a=1, a=2) on data (a=1, b=1) previously failed, but the
   comment "it will not create a list if there is not a match for every
   attribute in op" suggests that it should return (a=1).
 - Every (a=1) on data (a=2) previously succeeded (bug) while it would
   fail on (a=2, b=1). This is fixed now by checking whether any of the
   conditions really have matching data for the attribute.

Other changes: optimize merge_avpl and new_avpl_*_match to insert in
linear time instead of quadratic, rewrite and add comments in an attempt
to make it easier to understand. Merge the new_avpl_every_match and
new_avpl_exact_match functions and rename it to new_avpl_pairs_match to
reflects its actual implemented functionality.

Not addressed in this patch is the quasi-randomness of the returned
data AVPL. AVPLs are unordered, so the condition Strict (a?) on data
(a=1, a=2) could in theory return either (a=1) or (a=2). In practice
this returns (a=1) because of alphabetical ordering, but this cannot
really be relied on. It gets worse for conditions like Strict (a?, a>1),
these are considered undefined behavior (without warnings for now).

Ping-Bug: 12184
Change-Id: I0008448ffcb96183f106cb937c4f488e26a82f92
Reviewed-on: https://code.wireshark.org/review/17777
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-23 05:59:26 +00:00
Birol Capa 7477e1c3b9 Fix Profinet RPCInterfaceUUID decoding
The translation of all RPCInterfaceUUID for PNIO evaluates to "PNIO".
However, UUID allows distinction of
 - UUID_IO_DeviceInterface (IOD-IF)
 - UUID_IO_ControllerInterface (IOC-IF)
 - UUID_IO_SupervisorInterface (IOS-IF)
 - UUID_IO_ParameterServerInterface (PServ-IF)

Bug: 12938
Change-Id: I97c27808f61abd96728421488bb0ee5fdbace566
Reviewed-on: https://code.wireshark.org/review/17865
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>
2016-09-22 15:41:41 +00:00
Guy Harris d7fe514fc0 Improve support for single-character fields and filter expressions.
Add an FT_CHAR type, which is like FT_UINT8 except that the value is
displayed as a C-style character constant.

Allow use of C-style character constants in filter expressions; they can
be used in comparisons with all integral types, and in "contains"
operators.

Use that type for some fields that appear (based on the way they're
displayed, or on the use of C-style character constants in their
value_string tables) to be 1-byte characters rather than 8-bit numbers.

Change-Id: I39a9f0dda0bd7f4fa02a9ca8373216206f4d7135
Reviewed-on: https://code.wireshark.org/review/17787
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-19 02:51:13 +00:00
Pascal Quantin 29a243d61c irda: restore a line removed by mistake in ge4c059f
Bug: 12821
Change-Id: If6423c7f8443eccd6ddb4b699bbc327a965d0d74
Reviewed-on: https://code.wireshark.org/review/17477
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-09-04 09:54:17 +00:00
Guy Harris d781979550 Use "ecatf" as the protocol name, to parallel everything else.
The fields have names beginning with "ecatf.", the dissector is called
"ecatf", and it's only the frame layer of EtherCAT anyway, so just call
it "ecatf".

Change-Id: I2f127363fd115c307f0525f612fe184a30d46c55
Reviewed-on: https://code.wireshark.org/review/17406
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31 01:00:31 +00:00
Guy Harris a4c8ebc18b Don't do any Decode As stuff for dissector tables not used with Decode As.
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-31 00:08:01 +00:00
Dario Lombardo 91abbb3dd8 ethercat: fix check for SdoControl (CID 1256520).
Change-Id: I6a24974b41f9abee32e3a170b607062bf80f3368
Reviewed-on: https://code.wireshark.org/review/16990
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-08-10 19:32:08 +00:00
Michael Mann 9f4a294f22 Cleanup the final checkAPI g_warning complaints.
Change-Id: I7606ee55be4428909e255496c0344fffe5847f02
Reviewed-on: https://code.wireshark.org/review/16804
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-07-31 15:30:09 +00:00
Michael Mann 8b0e9c6672 Follow up for proto_tree_add_checksum.
Fill in the "gaps" so that all dissectors that verify checksums have both a
status and expert info field.

Also address comments from original proto_tree_add_checksum patch that didn't make it.

Ping-Bug: 8859
Change-Id: I2e6640108fd6bb218cb959fe9e4ba98a13e43a2f
Reviewed-on: https://code.wireshark.org/review/16590
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-27 03:40:02 +00:00
Michael Mann 907d49483d Fix some of the checkAPIs.pl warnings for g_warning.
1. Create ws_g_warning for legitimate uses of g_warning
2. Use proto_tree_add_debug_text
3. Comment some out

Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5
Reviewed-on: https://code.wireshark.org/review/16678
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-26 04:08:50 +00:00
Michael Mann 1da1f945e2 Fix checkAPI.pl warnings about printf
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-25 04:26:50 +00:00
Michael Mann 8505fb08c1 Fix shadow variable warnings.
Change-Id: I1e6bd722b3f04f171b462fc680ca080bb7ec03c7
Reviewed-on: https://code.wireshark.org/review/16625
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-07-24 15:16:14 +00:00
Pascal Quantin 53de2c2378 Convert more glib memory to wmem pinfo pool
Change-Id: I4cc23bc19a6bd8c6a8e0389eaf939dbb60fe0ca3
Reviewed-on: https://code.wireshark.org/review/16562
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-22 06:21:54 +00:00
Michael Mann ad6fc87d64 Add proto_tree_add_checksum.
This is an attempt to standardize display/handling of checksum fields for all dissectors.
The main target is for dissectors that do validation, but dissectors that just report the
checksum were also included just to make them easier to find in the future.

Bug: 10620
Bug: 12058
Ping-Bug: 8859
Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf
Reviewed-on: https://code.wireshark.org/review/16380
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-21 12:35:22 +00:00
Michael Mann 8cd167a06c Fix sscanf VS Code Analysis warnings.
Some needed to check return value, others were converted to use strtoul.

Change-Id: I55aae216f95362b67e006f6e682abbd5ae2c8dcc
Reviewed-on: https://code.wireshark.org/review/16502
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-07-17 01:47:46 +00:00
Guy Harris 7f92c24faf Widen some variables.
Perhaps they cannot ever have values > 65535, but there's really no
benefit to restricting them to 16 bits on the 32-bit and 64-bit
platforms on which we run, and this might address what CID 1364088 is
*really* complaining about.

Change-Id: I5238261d04783401873de89469f8e2906554add4
Reviewed-on: https://code.wireshark.org/review/16454
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-15 02:09:39 +00:00
Guy Harris ed69bf3bc7 Remove a compiler warning some platforms give.
Some UN*Xes declare an index() function, that being the name strchr()
originally had in V7 UNIX.  This causes warnings from compilers if you
have a variable named "index", so rename the variable.

Change-Id: Ibb046005d1ef911ce0739ce70a0a55c13310cdf0
Reviewed-on: https://code.wireshark.org/review/16372
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-10 17:24:15 +00:00
Bruno Verstuyft 35255d9aa6 DOCSIS: Added dissector for Downstream Profile Descriptor (DPD)
Change-Id: I97e6e07be45a5c4de6c8c467e0c782b35036bd98
Reviewed-on: https://code.wireshark.org/review/16202
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Adrian Simionov <daniel.simionov@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-10 15:06:34 +00:00
Martin Kaiser 2da35bce9a profinet, CID 1362120: check the return value of ftell()
change filePosRecord's data type to long, this is what ftell() and
fseek() expect

limit filePosRecord's scope to the block where it's actually used

if ftell() returns < 0, don't move the file pointer and don't call
fseek() with the negative offset

Change-Id: If5a43099c32e476a691f4d6cd26ed7fb73490fcf
Reviewed-on: https://code.wireshark.org/review/16258
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-07-03 14:20:46 +00:00
Martin Kaiser 6d4c976859 profinet: add a space to make checkhf happy
without the space, checkhf complains about an ei entry

martin@reykholt:~/src/wireshark.git$ ./tools/checkhf.pl plugins/profinet/packet-dcerpc-pn-io.c
ERROR: NO ARRAY: plugins/profinet/packet-dcerpc-pn-io.c, ei_pn_io_unsupported

Change-Id: Ie72efcec644225bc4f554117ae10672694823cad
Reviewed-on: https://code.wireshark.org/review/16257
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-07-03 11:46:24 +00:00
Adrian Simionov 791c93f58f DOCSIS: Update to Type 35 UCD
Change-Id: Ie0dda94894cfaec9bccbd69d52367034e1c629da
Reviewed-on: https://code.wireshark.org/review/16242
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-03 02:41:07 +00:00
João Valverde a16d401b25 Remove Makefile.common files
Now that nmake build system has been removed they are not needed anymore.

Change-Id: I88075f955bb4349185859c1af4be22e53de5850f
Reviewed-on: https://code.wireshark.org/review/16050
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-06-30 11:04:17 +00:00
Bruno Verstuyft fff248bb84 DOCSIS: Added dissector for OFDM Channel Descriptor
Change-Id: Idbbc1ad126e0b01952957a914bd9c16a990a9b9e
Reviewed-on: https://code.wireshark.org/review/16036
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-28 20:04:20 +00:00
Michael Mann 2ab4155794 tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_string
Also some other tricks to remove unnecessary tvb_get_string_enc calls.

Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914
Reviewed-on: https://code.wireshark.org/review/16158
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-27 15:20:06 +00:00
Bruno Verstuyft af26f31a63 DOCSIS: Fix unknown TLVs in UCD type29 caused parsing errors + bugfixes
Change-Id: I9ab56ded7ebf9f087afceed979e451e369eaf1d6
Reviewed-on: https://code.wireshark.org/review/15967
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-27 07:01:21 +00:00
Michael Mann 0bf1cb2342 Add address_to_bytes API.
This will copy an address's "byte format" into a buffer.  The original
intended design is for export_pdu functionality, which tries to do
this "manually" for many address types (and creates undesired dependencies)

The default functionality if a "byte format function" isn't provided
(currently the case for all address types) is a memcpy of the address
data.  Providing "address to byte" functions to aid export PDU
functionality will be provided later.

Change-Id: I3703f9e617a8cef09165ad53a0f98c6372676b9b
Reviewed-on: https://code.wireshark.org/review/16070
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-06-22 07:47:39 +00:00
Pascal Quantin a383e692c8 Revert "tap: change glib functions to wmem."
This reverts commit 2e9f3c5d36.

It breaks the registration of codec, dissector and libwiretap plugins.

Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de
Reviewed-on: https://code.wireshark.org/review/16012
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-19 10:47:10 +00:00
Dario Lombardo 2e9f3c5d36 tap: change glib functions to wmem.
Change-Id: I878ae6b121a669f9b7f4e1e57bc079f0cb44c0bf
Reviewed-on: https://code.wireshark.org/review/15270
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-17 15:38:03 +00:00
Pascal Quantin 6baa1b544c Remove Nmake build system
Change-Id: I3bd474f3cda9667dec66426b5729449953df3e61
Reviewed-on: https://code.wireshark.org/review/15777
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-06-15 19:21:57 +00:00
Michael Mann 0ef1d941ea Allow control of individual columns to be (un)writable.
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-15 06:03:57 +00:00
Jeff Morriss 3a590217ac Change how dissectors do late-field-registration to avoid a double-registration
assertion.

If a dissector forces registration of fields during dissection it needs to do
so in a way that clears the prefix registration.  Otherwise epan will call the
registration routine a 2nd time (which will cause us to assert out) if a user
types a display filter (with the dissector's prefix) that doesn't exist.

Update the proto_register_prefix() comments to reflect this.

Change-Id: I3ce29243395fb55192bb5dfd950baa88410ac136
Reviewed-on: https://code.wireshark.org/review/15881
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-15 05:38:01 +00:00
Jaap Keuter 4cab0516cc Store the tree item to add to later (CID-1159152)
The tree item needed to test and append to isn't being stored,
so the items are never amended with notes, resulting in dead code.

Change-Id: Ib1a9b7994ad12a9a9013d1bc1e1e4c165f34f20f
Reviewed-on: https://code.wireshark.org/review/15826
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-12 01:25:59 +00:00
Pascal Quantin b6ace80977 profinet: set ioDataObject structure to 0
Bug: 12486
Change-Id: I9e8be44325e0bdd5174bd01e4e1ea4922f7090cc
Reviewed-on: https://code.wireshark.org/review/15696
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-02 08:36:23 +00:00
Adrian Simionov bd932bb2e1 [docsis->type35ucd] Fix TLV 15 & 16 bugs
+ TLV 15 has value decoded as on off
+ TLV 16 shows text parameters instead of decimal value

Change-Id: I6f0baa410f12e20825379a3ff0cd6174aa2bc576
Reviewed-on: https://code.wireshark.org/review/15678
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-01 14:05:58 +00:00
Adrian Simionov 469719f39d [docsis->rngrsp] Packet decoded in greater detail
Next steps would be to add expert and add missing TLVs.

Change-Id: Ia05d81c380d412ab02e55bbfc08363d9153ff1c3
Reviewed-on: https://code.wireshark.org/review/15617
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-31 20:33:53 +00:00
Adrian Simionov e61804c362 [docsis->type35ucd] TLV 7 ON OFF
Change-Id: I5083346cb03de522d76632eba5ec9cbbf17666ea
Reviewed-on: https://code.wireshark.org/review/15603
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-05-29 06:34:42 +00:00
Guy Harris 19c0b8bbfd Don't use "== {TRUE,FALSE}" when testing whether a Boolean is true or false.
"if (boolean)" suffices to test for true, and "if (!boolean)" suffices
to test for false.

Most of the time, explicitly comparing against TRUE or FALSE is
harmless, although possibly slightly less efficient, as you're
explicitly testing against 1 rather than testing for "not zero".

*However*, if you want to test whether a given bit is set in a flags
field, "if ((flags & flagbit) == TRUE)" *DOES NOT WORK* unless "flagbit"
is equal to 1, because TRUE is equal to 1, and if "flagbit" is not equal
to 1, "flags & flagbit" will *NEVER* be equal to 1.

So comparing "== TRUE" is a bad habit to get into, as it might lead to
its use when doing bit testing.

While we're at it, clean up some other tests:

	"if (!(x == FALSE))" really means "x is true", so write it as
	such, i.e. "if (x)";

		if (a && b)
			do this;
		if (a && !b)
			do that;

	reads better as

		if (a) {
			if (b)
				do this
			else
				do that
		}

	when doing bit testing, there's no need to shift the bit, just
	test it (and, no, that doesn't conflict with the bit about TRUE
	being 1 - *just test the bit*, it's the standard C idiom).

Fixes CID 1362119.

Change-Id: I011154caae45307796ffd270d265c05a2533b1db
Reviewed-on: https://code.wireshark.org/review/15585
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-27 06:47:23 +00:00
T. Scholz c0e679e0a9 Cyclic PROFINET PROFIsafe RTC1 data dissection
New implemented functions for profinet plug-in to read cyclic RTC1 data
frames more detailed and further to dissect PROFIsafe on PROFINET frames.

New functions include:
- Reading the PROFINET "Ident OK" Frame for detailed module information,
  as ModuleIdentNr., SubModuleIdentNr., etc. total dynamically
- Improved the existing dissection of fParameter with usage of GSDML-files,
  as the indexnumber for those parameters can change
- Reading a GSDML-file for further module-information, such as PROFIsafe
  Module, etc.
- Aded new pnio protocol preferences, in which the user can define its own
  network path to his GSDML-files, so that Wireshark is able to read those
  files for detailed information output.
- Added new filter functions for PROFINET and PROFIsafe
- All gained and saved information will be used to dissect the cyclic
  PROFINET frames

Bug: 12216
Change-Id: I379da1d349fa099047953042f1aa30450bee5b30
Reviewed-on: https://code.wireshark.org/review/14119
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Birol Capa <birol.capa@siemens.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-26 12:43:26 +00:00
Michael Mann 1dccd1ee07 Have fvalue_to_string_repr always return an (wmem) allocated buffer.
Previous patches converted all fvalue_to_string_repr calls to expect
an allocated buffer (and not a passed in one).  Now changing signature
to force an allocated buffer.  Added wmem in case that can be taken
advantage of within epan (and since the function signature was changing
anyway).

Change-Id: Ica1ac4a9a182ce0e73303856329e198d9d525b7b
Reviewed-on: https://code.wireshark.org/review/15343
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-10 22:49:08 +00:00
Graham Bloice 2e23b506c7 Add checkAPI calls to CMake.
This generates a top level target, checkAPI, that is
excluded from the ALL build target, so must be run separately.

On Windows using a Visual Studio generator, call
msbuild /p:Configuration=RelWithDebInfo checkAPI.vcxproj

Change-Id: I44a57c564dcfc75499463b942436f4b920a82478
Reviewed-on: https://code.wireshark.org/review/14873
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2016-05-02 12:01:24 +00:00
Philip Rosenberg-Watt ba4888ed62 Update BPKM Auth Reply key length for DOCSIS 3.1
Wireshark was failing to parse DOCSIS 3.1 BPKM Response (Auth Reply)
messages with a key length of 256 bytes, which is in the DOCSIS 3.1
specification located here:

http://www.cablelabs.com/specification/docsis-3-1-security-specification/

See Appendix I.4 "Authorization Reply"

Change-Id: Ic50eb4a2d637a7bc47385b7c0a96c830f7a920be
Reviewed-on: https://code.wireshark.org/review/15149
Reviewed-by: Alexis La Goutte <alexis.lagoutte@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-04-29 04:50:46 +00:00
Jeff Morriss 363507ea18 Add a rule to build lemon so any target that depends on it can (re)build it if necessary.
See, for example:

https://ask.wireshark.org/questions/52045/make-c-plugins-fails-looking-for-target-toolslemonlemonc

Also add another lemon dependency for MATE.

Change-Id: Ifc62e174fb6dc4247887607ad37a505b36d83134
Reviewed-on: https://code.wireshark.org/review/15143
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2016-04-28 18:56:09 +00:00
João Valverde ac8e08b6c7 Remove empty files
Change-Id: I9b5b78ca26dd1190e43d2e7e953f4fb119921103
Reviewed-on: https://code.wireshark.org/review/14927
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-04-15 09:00:44 +00:00
João Valverde ecb4dc396e Include ws_diag_control.h in config.h
Change-Id: Ia394071710ecda3b0e6686a51fbca45a8ff20317
Reviewed-on: https://code.wireshark.org/review/14749
Petri-Dish: João Valverde <j@v6e.pt>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04 23:05:31 +00:00
Guy Harris c04721abba Don't double-close the input.
Change-Id: I9b345ee28a59596369efac8bdd0a51447d723017
Reviewed-on: https://code.wireshark.org/review/14803
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-04 01:55:50 +00:00
Guy Harris 59816ef00c Make the Flex scanners and YACC parser in libraries reentrant.
master-branch libpcap now generates a reentrant Flex scanner and
Bison/Berkeley YACC parser for capture filter expressions, so it
requires versions of Flex and Bison/Berkeley YACC that support that.

We might as well do the same.  For libwiretap, it means we could
actually have multiple K12 text or Ascend/Lucent text files open at the
same time.  For libwireshark, it might not be as useful, as we only read
configuration files at startup (which should only happen once, in one
thread) or on demand (in which case, if we ever support multiple threads
running libwireshark, we'd need a mutex to ensure that only one file
reads it), but it's still the right thing to do.

We also require a version of Flex that can write out a header file, so
we change the runlex script to generate the header file ourselves. This
means we require a version of Flex new enough to support --header-file.

Clean up some other stuff encountered in the process.

Change-Id: Id23078c6acea549a52fc687779bb55d715b55c16
Reviewed-on: https://code.wireshark.org/review/14719
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-03 22:21:29 +00:00
Adrian Simionov 878a277b08 [docsis->mdd] Add support for TLV 1.7
Change-Id: I9e67ccee06c93c25c766fae8bdd8a9890416655f
Reviewed-on: https://code.wireshark.org/review/14648
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>
2016-03-28 10:17:11 +00:00
Alexis La Goutte 9dd085d3d6 ethercat: Fix Control flow issues MISSING_BREAK (CID 1357204)
Change-Id: I7efc9b4b44590e3408ba058d7aa02f843cbfeca4
Reviewed-on: https://code.wireshark.org/review/14642
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-03-26 22:19:10 +00:00
Stig Bjørlykke 07fb53b063 ethercat: Use tfs_ecat_fmmu_typeread
Change-Id: I928fc0eeeac99156fb50a97b5497913ca6e67350
Reviewed-on: https://code.wireshark.org/review/14610
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-03-24 11:02:30 +00:00
Stig Bjørlykke 781291d089 Revert "Fix compile error by removing an unused variable: git/plugins/ethercat/packet-ethercat-datagram.c:513:32: error: unused variable 'tfs_ecat_fmmu_typeread' [-Werror,-Wunused-const-variable] static const true_false_string tfs_ecat_fmmu_typeread = "
This reverts commit bc3bd625e1.

Change-Id: Iaf1e6fe51c20811761d18e86dc8b2c8402a2c89a
Reviewed-on: https://code.wireshark.org/review/14609
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-03-24 11:01:25 +00:00
Joerg Mayer bc3bd625e1 Fix compile error by removing an unused variable:
git/plugins/ethercat/packet-ethercat-datagram.c:513:32: error: unused variable
      'tfs_ecat_fmmu_typeread' [-Werror,-Wunused-const-variable]
static const true_false_string tfs_ecat_fmmu_typeread =
                               ^
1 error generated.

Change-Id: I7b215b9f2dafa04c6aae4a22fb6ae256f65e8585
Reviewed-on: https://code.wireshark.org/review/14597
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-23 19:50:19 +00:00
richardk 6a3a85f318 Added dissection of most of the ESC( EtherCAT slave controller) registers.
Change-Id: Idee70e6eaa926efb74cd4ff0bb529a601edbb67e
Reviewed-on: https://code.wireshark.org/review/13729
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-23 11:44:48 +00:00
Michael Mann 1e60d63c8c Create call_data_dissector() to call data dissector.
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-20 17:38:03 +00:00
Michael Mann 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +00:00
Michael Mann e37275bfde Associate dissector tables and heuristic subdissector lists with a protocol.
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-17 00:05:17 +00:00
Adrian a69d07dca0 [docsis->mdd] Add support for TLV 1.6
Change-Id: I5c7529bc630ad7312011b04ce101ba3608041d35
Reviewed-on: https://code.wireshark.org/review/14435
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-12 15:08:27 +00:00
João Valverde c524d73a67 Revert "autotools: Use -Werror with clean plugin code"
This reverts commit 31654e5e5c.

Change-Id: I27f3465c680daa599b96a7259ca93f96f2a622a5
Reviewed-on: https://code.wireshark.org/review/14324
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-03 13:24:58 +00:00
João Valverde 31654e5e5c autotools: Use -Werror with clean plugin code
Change-Id: I0bc94702eaf87924467e6129ac22f4755308f8d3
Reviewed-on: https://code.wireshark.org/review/14319
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-03-03 11:27:43 +00:00
Michael Mann 68dede24d1 IrDA: Register a link-layer IrLAP address type".
Was using AT_NONE as "unknown address type" instead of "no address".

Ping-Bug: 12205
Change-Id: Ic1d7022f8eaa3dfab9bb7b607eed264cc527c87c
Reviewed-on: https://code.wireshark.org/review/14242
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-01 03:13:49 +00:00
Alexis La Goutte 95fb7259d8 gryphon: fix 'gryphon.reserved' exists multiple times with NOT compatible types: FT_BYTES and FT_UINT32
Change-Id: Ia2ef8c4211ca717d6e99f596cd7f2de92d5aa7ca
Reviewed-on: https://code.wireshark.org/review/14202
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-28 02:09:26 +00:00
Alexis La Goutte 9ef7b92193 irda: fix 'irlmp.xid.name' exists multiple times with NOT compatible types: FT_BYTES and FT_STRING
Change-Id: I93215bd126dab1e7b6207f8510c7ce9b116637a3
Reviewed-on: https://code.wireshark.org/review/14203
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-27 18:45:10 +00:00
João Valverde e4c059f67f Add free_address_wmem(), fix warnings [-Wcast-qual]
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-26 23:09:43 +00:00
João Valverde f0fb79d534 autotools: Use pkg-config autoconf macros for GLib/GTK
Remove mostly obsolete aclocal macros. Make GTK build flags a strict superset
of GLib flags. Use GTK build variables for GTK GUI and GLib elsewhere. Add
dependency flags explicitly instead of using WS_CPPFLAGS.

Some minor improvements and fixes for missing/unnecessary variables (no impact
on our test builds).

Change-Id: I3e1f067a875f79d6516c1fa7af986f17a7a6b671
Reviewed-on: https://code.wireshark.org/review/14005
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-21 07:51:55 +00:00
João Valverde 5eafa903f6 autotools: Move common automake code for plugins to an include file
Change-Id: Icac1eb17ff78ae5ae54b61820618bf3c5733bd96
Reviewed-on: https://code.wireshark.org/review/14003
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-20 14:26:39 +00:00
João Valverde 5066cf8690 Fix format string warnings [-Wformat=]
Change-Id: I266c7d422f6ade965b42a4e2e8dc01966f8eb5f8
Reviewed-on: https://code.wireshark.org/review/13932
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-14 23:47:43 +00:00
Alexis La Goutte e46585582c unistim: fix broadcast_phone_msgs’ defined but not used [-Werror=unused-const-variable] found by gcc6
Change-Id: Icdf648e820c7a81546249c0e5060d8537278ffa4
Reviewed-on: https://code.wireshark.org/review/13904
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-12 09:21:49 +00:00
Alexis La Goutte 77050a86f3 Profinet (pn-mrp): fix statement is indented as if it were guarded by... [-Werror=misleading-indentation] found by gcc6
Change-Id: I1d8709857cf3e1e65bca0c0c94629c47fc1a3c06
Reviewed-on: https://code.wireshark.org/review/13903
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-12 09:19:56 +00:00
João Valverde ef929dc8eb Revert "Add free_address_wmem() and other extensions to address API"
This reverts commit 13ec77a9fc.

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-08 00:44:22 +00:00
João Valverde 13ec77a9fc Add free_address_wmem() and other extensions to address API
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-02-07 23:22:30 +00:00
Guy Harris 2079e5da30 Get rid of an unused variable.
Change-Id: I2f99327feafe95524c24718b320a8490779ad6c5
Reviewed-on: https://code.wireshark.org/review/13698
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-03 21:49:12 +00:00
richardk 0421e78988 Fixed bug when the actual remaining command data is less than the size
specified in the EtherCAT mailbox header.

Change-Id: I661c62af915b9455da1df49f5746953d41dc527a
Reviewed-on: https://code.wireshark.org/review/13595
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-03 14:51:19 +00:00
João Valverde 0450cfa50f Try to fix 'make distcheck'
Change-Id: I1656ca8e86e506f39ef7f7600bd9d5a21670ad1e
Reviewed-on: https://code.wireshark.org/review/13589
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-29 00:55:04 +00:00
João Valverde d9fa93150e Another fix for g265a41e
Disable -Werror as before.

Change-Id: Iec27be6eba742555bce28bb1c81c2e15153db566
Reviewed-on: https://code.wireshark.org/review/13588
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-28 23:28:57 +00:00
João Valverde 268c0e56fb MATE: Disable Werror as before g265a41e
Change-Id: Ia89f40245e5b7eab2dc23ce7b37d5107863bbfdd
Reviewed-on: https://code.wireshark.org/review/13583
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-28 20:29:40 +00:00
João Valverde 265a41e14d autotools: Don't use "user variables" to set build flags
GNU coding standards recommend against it and automake is designed
around it.

This allows overriding the global build flags using AM_CFLAGS, etc.,
or per object flags, something that is difficult or impossible currently
because of automake precedence rules.

Change-Id: I3f1ea12e560af5a46b2f04b342b1882bbf123f12
Reviewed-on: https://code.wireshark.org/review/13455
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-28 18:13:48 +00:00
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
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-24 03:41:28 +00:00
Guy Harris a7f470fa24 More pinfo->fd->abs_ts to pinfo->abs_ts.
Change-Id: I70db0a345cc4c5c57c454371deb4f92f9ac4b9ac
Reviewed-on: https://code.wireshark.org/review/13501
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 03:58:56 +00:00
richardk b275ea864a Swapped align error and crc error bit in EtherCAT Switch Link dissector.
Change-Id: I218b1c412c5b8e41025c6a9434caef38653a36df
Reviewed-on: https://code.wireshark.org/review/13262
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-01-13 20:38:35 +00:00
Peter Wu bf0f5a982b Use result of register_dissector
Assign result of `register_dissector(..., func, proto)` to FOO_handle
and remove `FOO_handle = create_dissector_handle(func, proto)`.

Found by looking for files named packet-FOO.c having the above
create_dissector_handle pattern. Some files (with different dissect
routines for the two functions) remain unchanged.

Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90
Reviewed-on: https://code.wireshark.org/review/13247
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-13 11:36:29 +00:00
Guy Harris fe7cbcad86 WS_DLL_PUBLIC_DEF is for definitions; WS_DLL_PUBLIC is for declarations.
Change-Id: I16d5981c8c76d59d19be0600e218495f1f6552b2
Reviewed-on: https://code.wireshark.org/review/13215
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-12 08:00:48 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
AdrianSimionov 7888c43a57 [docsis->INIT-RNG-REQ] Correction for INFO field
Most probably this issue was introduced as a copy paste from RNG-REQ packet when INIT-RNG-REQ packet was first created.

Change-Id: I5eb0ac666c76b48d70b3383312f0598b6110cc03
Reviewed-on: https://code.wireshark.org/review/13085
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-07 01:07:46 +00:00
AdrianSimionov c752daf4b8 [docsis->bpkmattrib] Correction for TLV 15 text from 14->15
Change-Id: Ic1122e36c8099c1f891d3d5f81bd7fb4977d2ffd
Reviewed-on: https://code.wireshark.org/review/12880
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-28 18:30:24 +00:00
AdrianSimionov ebd44dbf80 [docsis->sync] Remove colon from INFO field
SYNC is a simple message, there is no info to follow the colon.
Most probably was introduced as a copy paste from more complex packets.

Change-Id: I552aad68f9484f347266838e9c319de680825dde
Reviewed-on: https://code.wireshark.org/review/12879
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-28 00:37:16 +00:00
João Valverde 2aab706c5a Remove -Wwrite-strings compiler flag
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are
not useful, they're impossible to fix in a sane way and therefore are being
handled with casts of static strings to (char *).

This just moves the warning to [-Wcast-qual] and a compiler pragma is
in turn required (and used) to squelch that warning.

Remove the Wwrite-strings warning. Let that responsibility fall on the
programmer (as is done by casting).

Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5
Reviewed-on: https://code.wireshark.org/review/12162
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-12 16:21:19 +00:00
Michael Mann 210dc9b301 new_create_dissector_handle -> create_dissector_handle for plugins.
Change-Id: I0d485b1337c669291ad58b6c096657ce2db353c8
Reviewed-on: https://code.wireshark.org/review/12516
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-11 03:42:52 +00:00
Michael Mann 1474f49f19 new_register_dissector -> register_dissector for remaining uses.
Mostly plugins, but also LUA and generated skinny dissector.

Change-Id: Ifeb4205442f9a60875266b4e82841ff38b4fdb63
Reviewed-on: https://code.wireshark.org/review/12515
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-11 03:42:37 +00:00
Hannes Mezger 62b64e3942 opcua: expand ReturnDiagnostics field of RequestHeader
The ReturnDiagnostics field of RequestHeader is a bitmask. It cannot be generated, as the information needed is not contained in our models used to generate the generated files. This is why I made a manual change to opcua_complextypeparser.c. In the future, this change has to be merged if the file gets regenerated.

Change-Id: Ic7db499566e3f3d3006feaff6e25e7b37a427dca
Reviewed-on: https://code.wireshark.org/review/12470
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-08 02:18:02 +00:00
Hannes Mezger 3a4d387658 opcua: fix order of ExpandedNodeId bits
Make fields appear from right to left bit instead of mixed

Change-Id: I78152eab6901440f483b0af7d2395edebaa7ab3d
Reviewed-on: https://code.wireshark.org/review/12469
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-08 01:02:09 +00:00
Guy Harris f51bad11d7 Use noyywrap rather than defining our own yywrap functions.
Tweak lemonflex-tail.inc to fix an issue this reveals.

It appears that, at least on the buildbots, the Visual Studio compiler
no longer issues warnings for the code generated with %option noyywrap.

Change-Id: Id64d56f1ae8a79d0336488a4a50518da1f511497
Reviewed-on: https://code.wireshark.org/review/12433
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-05 08:06:50 +00:00
Stig Bjørlykke 9779ae3817 Removed some remaining svn Id tags
Change-Id: I7ffbf59099132cde55995bde991d1c6a5dd224b0
Reviewed-on: https://code.wireshark.org/review/12330
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-01 14:41:25 +00:00
Michael Mann 3606f80d9e Officially remove tvb_get_string and tvb_get_stringz.
Almost all replacements were done awhile ago, just put the final nail in the coffin.

Change-Id: I0a708d886da5a500c2a1e2c9ee2736794bdb9411
Reviewed-on: https://code.wireshark.org/review/12206
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-27 05:11:25 +00:00
Michael Mann 10261d1202 Remove manual setting of pinfo->current_proto.
Calling a protocol dissection function will properly set/restore pinfo->current_proto, so there's no need to duplicate it.

Change-Id: Ic2ec0b35fa4d46a98f3410bf238056425076e4a9
Reviewed-on: https://code.wireshark.org/review/12205
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-27 05:00:37 +00:00
Birol Capa 7b1025624d Profinet: All SubframeData elements are not decoded
In PDevData/PDirSubframeData/SubframeBlock, not all SubframeData elements are decoded/shown.
However, all bytes of the SubframeBlock are highlighted in the binary stream correctly.

Change-Id: Ic69999dff524e2e0c48a619def111c4bf9cca5e1
Reviewed-on: https://code.wireshark.org/review/12100
Reviewed-by: Alexis La Goutte <alexis.lagoutte@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>
2015-11-25 08:28:54 +00:00
Birol Capa dee1c6e4d5 Profinet: ARProperties that contains Combined Object Container Bit
New ARProperties has a bit that contains if usage of Combined Object Container is required or not.

Change-Id: Ia4420cdf161d79933fcc0d8ffb411c02bfe26f3b
Reviewed-on: https://code.wireshark.org/review/12098
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-25 05:40:40 +00:00
Graham Bloice eaac7de007 Developers Guide updates for plugins with CMake
Remove references to nmake, add references to CMake.

Change-Id: Iea2d2b2fbdbab131bae823d5d6a5306630a70347
Reviewed-on: https://code.wireshark.org/review/12079
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-24 06:04:57 +00:00
AdrianSimionov 61082a2203 [docsis->type35ucd] Add support for type 35 UCD message.
* Added support for TLV 20
* Added support for TLV 21
* Added support for TLV 22
* exceptions.h not needed compared to packet-ucd.c
and packet-type29ucd.c
* value_string iuc_vals3 became static const compared
to packet-ucd.c and packet-type29ucd.c
* if(tree) was removed to allow usage of expert on TLV length
* HEX crafted packet capture in Bug 11745

Bug: 11745
Change-Id: If21a44cf26941468747772cefffe29bafacb1c7c
Reviewed-on: https://code.wireshark.org/review/11956
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>
2015-11-24 06:00:17 +00:00
Michael Mann 57e18b0034 register_dissector -> new_register_dissector
Change-Id: Ifc8208e1b96e2a3bf297912500a5f252bfa8eed9
Reviewed-on: https://code.wireshark.org/review/12073
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-23 17:36:39 +00:00
AdrianSimionov 782be9a50f [docsis] Remove unused exceptions.h
* Add static const to IUC vals
* I defined the IUC values local to packet-map.c packet because it
needs to be revised, not all IUC apply to all packets. It works for now
but some of the IUC might be gone.

Change-Id: Ib4da9ae8e29afca065153c3934336565371da9a9
Reviewed-on: https://code.wireshark.org/review/11993
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>
2015-11-22 08:26:47 +00:00
AdrianSimionov fefc14b121 [docsis->ucd] Dissect TYPE and LENGTH values for burst TLVs also.
* Fixed filter for TLV Length Wrong.

Change-Id: Ic2fa2a6e1faa7bad604468fbcbc431fd38a5a113
Reviewed-on: https://code.wireshark.org/review/11922
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>
2015-11-20 12:33:19 +00:00
Pascal Quantin cf562210de Profinet: use pinfo pool to build conversation filter
Packet pool cannot be used from GUI.

Bug: 11730
Change-Id: I4f5764a38a10809373c365ecf1ea50404a15b89a
Reviewed-on: https://code.wireshark.org/review/11966
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-19 17:03:13 +00:00
AdrianSimionov 8504d54c7c [docsis-type29ucd] Changed TLV Length Bad filter to make more sense
Change-Id: Idd7dcada277a25b547b0492ca272e5fbba48361d
Reviewed-on: https://code.wireshark.org/review/11938
Reviewed-by: Alexis La Goutte <alexis.lagoutte@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>
2015-11-19 07:53:01 +00:00
Michael Mann 3ca5e3ec7d create_dissector_handle -> new_create_dissector_handle for plugins
Was able to actually convert all calls to "new style"

Change-Id: If9916a4762d410f2ad12aa5431174d7462dc7ac4
Reviewed-on: https://code.wireshark.org/review/11941
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-18 17:44:49 +00:00
AdrianSimionov 2cbb58366e [docsis->type29ucd] Update to DOCSIS 2.0
* Added 3 missing TLVs from Type 29 UCD.
* Added to dissector the TLV Type and TLV Length as I want
to be able to add filters on this information as an user.
* Changed some variable names as I wanted it to be unified between
the Type 2 UCD (ucd.c) and this file. There are another two types of
UCD messages (which I hope I will add) and keeping variables
similar helps a lot.
* Added the expert info.

Change-Id: I808a2e710f7348eb046e0afdaa609fa28b3a18ca
Reviewed-on: https://code.wireshark.org/review/11913
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-18 00:30:52 +00:00
AdrianSimionov 6c1ae95dc7 [docsis->ucd] Removed S-CDMA bursts and added expert
UCD Type 2 is for TDMA/ATDMA, S-CDMA goes in UCD Type 29.
More info:
Table 8-19 from RFIv2.0-C02 for DOCSIS 2.0
Table 6-25 from MULPIv3.1-I07 for DOCSIS 3.1

The comment was removed because the Burst Descriptors below are
not new anymore, are just Burst Descriptors like all the rest.

Change-Id: I992a84c9bf0b999b9cec5bd44f2e584ef22ce401
Reviewed-on: https://code.wireshark.org/review/11847
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>
2015-11-16 07:12:02 +00:00
AdrianSimionov 974a9e3f67 [docsis->type29ucd] Remove Type 4 Burst from Type 29 UCD
Most probably this was a copy/paste from packet-ucd.c
Type 4 and Type 5 bursts exist only in Type 2 UCD message.
Type 29, 35 and 51 UCD messages have only type 5 bursts.

Change-Id: I016e6b47c28f2cf69befa495848058c038603b46
Reviewed-on: https://code.wireshark.org/review/11841
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-11-15 22:10:18 +00:00
AdrianSimionov 4dea5dbc90 [docsis->ucd] Add support for 6 new TLVs
Change-Id: I65a40b1765f8433c47acbc34452d5336d7df84c1
Reviewed-on: https://code.wireshark.org/review/11788
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-15 01:51:40 +00:00
AdrianSimionov a595c70970 [docsis->packet-tlv.c] Updated Confirmation Code list per MULPIv3.1-I07 Annex C.4
Change-Id: Id6ec9776545c79a4f8e21fd212b87ddcd9fd376f
Reviewed-on: https://code.wireshark.org/review/11829
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-15 01:51:22 +00:00
Michael Mann 159227a14b register_dissector -> new_register_dissector for plugins.
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: Ie98e071a7cb568c13c8958de56b1fc25a4ce2ce9
Reviewed-on: https://code.wireshark.org/review/11831
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-14 21:54:39 +00:00
AdrianSimionov 91290f7b6c [docsis] Support for Queue Depth-based Request Frame
Change-Id: Ieeb79e4e248bdd8ee239c003e41ede0955e1cf86
Reviewed-on: https://code.wireshark.org/review/11766
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-13 07:40:09 +00:00
AdrianSimionov 6a56224c18 [docsis->packet-tlv.c] Update for modem capabilities TLV 5, subTLV 2 and subTLV 33
Change-Id: I63410d90e65a46aaeb534cca56e8797ebe00bf6f
Reviewed-on: https://code.wireshark.org/review/11685
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-10 19:37:28 +00:00
Guy Harris 0162e54075 Clean up includes of unistd.h, fcntl.h, and sys/stat.h.
Have wsutil/file_util.h include them on UN*X, just as it includes io.h
on Windows, so we can have a rule of "if you do file operations, include
<wsutil/file_util.h> and use the routines in it".

Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't
necessary (whether because of the addition of them to wsutil/file_util.h
or because they weren't needed in the first place).

Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f
Reviewed-on: https://code.wireshark.org/review/11619
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-07 21:52:23 +00:00
Guy Harris ce22578996 Don't include io.h in Flex scanners - they're not interactive.
We don't have any Flex scanners that support an interactive command-line
interface, so none of our scanners are, or need to be, interactive.
Mark text2pcap's scanner as not interactive.

That means none of our scanners should call isatty(), so they don't have
any need to include <io.h> on Windows; remove that include from the
Lucent/Ascent text capture scanner.

Update a comment to reflect that what matters isn't whether we can read
from a terminal or whether we actually do so, what matters is whether
they read *interactively* from a terminal (if you want to run text2pcap
reading from the standard input and type at it, be my guest).

Change-Id: I59979d1fdb37e1913125a400963ff7a3fa6b9bbd
Reviewed-on: https://code.wireshark.org/review/11587
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>
2015-11-06 01:14:31 +00:00
Michael Mann 02dcf3cc72 Don't allow DCE/RPC dissector table to have duplicates
Add "placeholders" in Profinet dissector to make that possible.

Change-Id: I000069ec72b5810c5675a30df1c121aa179000b3
Reviewed-on: https://code.wireshark.org/review/11557
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 15:51:07 +00:00
Michael Mann 74541a9596 Don't allow multiple registrations of a protocol in dissector tables.
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing.

The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not.  It's just ENFORCED for Decode As.

Bug: 3949
Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127
Reviewed-on: https://code.wireshark.org/review/11405
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 12:39:40 +00:00
João Valverde 3df2333155 Remaining ADDRESS macro to address function conversions
Change-Id: I8bc9af431e70243b05f4f0ce8c2b8ee451383788
Reviewed-on: https://code.wireshark.org/review/11463
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-03 12:20:34 +00:00
Alexis La Goutte 6c9ddbda65 EtherCAT: wrong display name
Wireshark is showing 2 consecutive bytes named "SubIdx" in a SDO info request (OpCode = 0x5) and response (OpCode = 0x6). But the second byte should be the "ValueInfo" instead in both request and response.

Issue reported by ThoKu

Bug:11652
Change-Id: I7f6395208d38e714071de5dbb40e3ddb9829f210
Reviewed-on: https://code.wireshark.org/review/11397
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-29 14:32:37 +00:00
Guy Harris a8a4098e12 "Color dissector filters" are just filters.
Rename the color_dissector_filters.[ch] files to just
dissector_filters.[ch], and rename the routines not to include the
string "color_", as those filters can be used as color filters *or*
display filters.

Remove "color_" from other places where we're not doing colorization.

In the GTK+ code, combine the two loops that add menu items for filters
in the dissector-provided filters list into one.

Change-Id: I08ecccc6b1b1be675e4129a0589f36c9f240407c
Reviewed-on: https://code.wireshark.org/review/11379
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-29 03:32:30 +00:00
Hannes Mezger e1ed17f927 opcua: display string representation of AttributeId and DeadbandType
Change-Id: I41f100ddab544054f8fab89f3f5da61866db7a2d
Reviewed-on: https://code.wireshark.org/review/11309
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-27 17:47:26 +00:00
Michael Mann 616dbd78d6 Replace all "dissector filter" registrations with "dissector color filter" registration.
In the GTK, there was "colorize" (via context menu using color_dissector_filter.{c,h}) or "not colorize" (via main menu using dissector_filters.{c,h}).  In Qt, you have the option to colorize (via context menu using color_dissector_filter.{c,h}) or not colorize (via main menu using color_dissector_filter.{c,h}).

Combine all into "colorize" and convert GTK to use color_dissector_filter.{c,h} in the "not colorize" main menu like Qt.

Change-Id: Ib3ca1c822f5f66ab5b812632d808f7905b328483
Reviewed-on: https://code.wireshark.org/review/11263
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-27 11:41:35 +00:00
Gerald Combs 4f39c603c2 More ADDRESS macro to address function conversions.
Replace remaining calls to SET_ADDRESS, CMP_ADDRESS, ADDRESSES_EQUAL,
COPY_ADDRESS, and COPY_ADDRESS_SHALLOW with their lower-case
equivalents.

Replace all ADD_ADDRESS_TO_HASH calls with add_address_to_hash.

Change-Id: I4cff857d7a84085abe0bccd52d2605d2a468bf6f
Reviewed-on: https://code.wireshark.org/review/11229
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: Michael Mann <mmann78@netscape.net>
2015-10-24 01:44:24 +00:00
Thomas Wiens a86acb2ac7 Profinet: Add Watchdog Factor data field in IOCRBlockReq.
The Watchdog Factor was displayed as Data Hold Factor, which was wrong.
Attribute type of the Watchdog Factor is also Unsigned16.

Change-Id: Ic5f32b9b322c225361be50b1f4a3180638a0c88b
Reviewed-on: https://code.wireshark.org/review/11161
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-20 03:21:58 +00:00
Gerald Combs b05803db4b CMake: Add /WX
Add "/WX" to the Visual C++ compiler flags if DISABLE_WERROR is off,
similar to config.nmake.

We haven't compiled C++ code with -Wshorten-64-to-32 for quite 
some time so there's no need to add -Wno-shorten-64-to-32 in
ui/qt/CMakeLists.txt.

Additionally, squelch

----
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3050) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3065) : see reference to function template instantiation 'void std::_Median<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_RanIt,_Pr)' being compiled
        with
        [
            _RanIt=QList<QString>::iterator
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3127) : see reference to function template instantiation 'std::pair<_RanIt,_RanIt> std::_Unguarded_partition<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
        with
        [
            _RanIt=QList<QString>::iterator
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3157) : see reference to function template instantiation 'void std::_Sort<_Iter,int,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Diff,_Pr)' being compiled
        with
        [
            _Iter=QList<QString>::iterator
,            _RanIt=QList<QString>::iterator
,            _Diff=int
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
        .\rpc_service_response_time_dialog.cpp(130) : see reference to function template instantiation 'void std::sort<QList<QString>::iterator,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
        with
        [
            _RanIt=QList<QString>::iterator
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3051) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3052) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3053) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
----

in both rpc_service_response_time_dialog.cpp and wireshark_application.cpp
so that we'll compile successfully.

Change-Id: I457bcede99dcb1f3c1001f1f559c4901bb000357
Reviewed-on: https://code.wireshark.org/review/10533
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-16 21:32:22 +00:00
João Valverde a643d14187 Change proto_tree_add_ipv6() to take a struct e_in6_addr pointer
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too.

Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88
Reviewed-on: https://code.wireshark.org/review/10953
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: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-14 12:18:00 +00:00
Hannes Mezger a542eec6d8 regenerate files adding new UA Specification 1.03 services and types
Change-Id: Ib39c33c6f90566f2807fa7bf9c7f1521a8f5cc35
Reviewed-on: https://code.wireshark.org/review/10979
Reviewed-by: Alexis La Goutte <alexis.lagoutte@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>
2015-10-14 04:25:21 +00:00
Hannes Mezger 4fee6a36b5 add new UA Specification 1.03 StatusCodes
Change-Id: If4df7d74920d3216d609894b8281408c1374e60f
Reviewed-on: https://code.wireshark.org/review/10978
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-14 04:24:28 +00:00
Jeff Morriss ea753e4288 Fix capitalization in MATE's "you need to restart to reconfigure" message.
Fix up some formatting and white space while we're there.

Change-Id: I869659d6fb1f8b4946f6e13a928ecd53dbabf1a4
Reviewed-on: https://code.wireshark.org/review/10807
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-10-05 19:09:12 +00:00
Michael Mann c913a61c74 MATE: Add ~ operator support
Bug: 9025
Change-Id: Ica92a7026ba8a89a8970b76e4e7d27f9e6288eb6
Reviewed-on: https://code.wireshark.org/review/10760
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-10-05 18:48:16 +00:00
Michael Mann 9b83b091b4 Don't count packets twice for average using avg_stat_node_add_value_notick.
Bug: 10535
Change-Id: I9c61a1f10f257bc6dd390c2a9370653bbd45b205
Reviewed-on: https://code.wireshark.org/review/10772
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05 12:35:52 +00:00
Jeff Morriss 0472d1ecad mate.released_time is added as a float so register it as such.
As noted in:
https://ask.wireshark.org/questions/45835/wireshark-mate-correlation-multiple-gops

Realistically all MATE's times should probably be converted to
FT_RELATIVE_TIMEs but that's a project for another day.

Change-Id: I11f640be769d16ccfd787ae2d7f3837fa03ad379
Reviewed-on: https://code.wireshark.org/review/10537
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-15 17:18:41 +00:00
Alexis La Goutte 8491be3a9e WIMAX (msg_ucd): fix will never be executed [-Wunreachable-code]
Move declaration for avoid https://llvm.org/bugs/show_bug.cgi?id=19020

Found by Clang 3.7

Change-Id: Ibb14b00d7af2cb0d24eb153d40640a2f9ee4f887
Reviewed-on: https://code.wireshark.org/review/10379
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-07 14:23:06 +00:00
Pascal Quantin c4538def97 UNISTIM: fix dissection of some audio commands
Bug: 11497
Change-Id: Ifb7aeed83f9ac091349387bc425925d2441d1c06
Reviewed-on: https://code.wireshark.org/review/10365
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-02 21:03:58 +00:00
Alexis La Goutte 2e1fa634c6 Lemon grammar: fix indent (use tabs)
Change-Id: I6fa38d5d85b25ac6c55fcfa67d6c8dba8482cc8c
Reviewed-on: https://code.wireshark.org/review/10266
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>
2015-08-27 04:35:23 +00:00
Joerg Mayer 2336743443 Remove some svn $Author$ lines that escaped previous cleanups.
git does keep of this in a much better way anyway.

Change-Id: I9923516105e63e72878e0ed34c74eed44453ab01
Reviewed-on: https://code.wireshark.org/review/10207
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-08-23 13:05:33 +00:00
João Valverde 532070b4e7 Add support for IPv6 stats tree statistics
Also add support for alphabetizing stat tree items as the addition of IPv6 stats tree makes it more obvious its needed.

Change-Id: I8b319ceac805ce7e3a1fd59f92c1c6fe2a54d3de
Reviewed-on: https://code.wireshark.org/review/10062
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>
2015-08-22 08:30:52 +00:00
João Valverde 3755bc6401 Fix IP Destinations stats tree
Change-Id: I875ecb05e0919e81e6d8d1d00f802c8d5df5b214
Reviewed-on: https://code.wireshark.org/review/10053
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: Hadriel Kaplan <hadrielk@yahoo.com>
2015-08-16 17:09:49 +00:00
Guy Harris 504f5b3478 Clean up some fields.
The "LEN" field is the "length of the MAC frame", in bytes; confusingly,
it includes the extended header length, but not the fixed-length part of
the header (including the FCS), so it's not the "length after HCS".

Rename it to "docsis.len", as it's always LEN, not SID; there's a
separate field for the SID.

Rename the Extended Header Length field to docsis.ehdrlen, and the
Number of Concatenated Frames to docsis.concat_cnt, so that different
uses of the "MACPARM" part of the header are flagged differently.

Update some comments while we're at it.

Change-Id: Ib7c4a0cda65cef25dcaf0051b3de89758ef4c29c
Reviewed-on: https://code.wireshark.org/review/9881
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-05 20:01:19 +00:00
Michael Mann 21e5a950ad Remove all preferences related to enabling/disabling heuristic dissectors.
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector.

Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled.

Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22
Reviewed-on: https://code.wireshark.org/review/9610
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17 17:12:22 +00:00
Michael Mann be7d295fbf Add "user presentable" and "unique string ids" to heuristic table entries.
This allows better presentation of heuristic dissectors to the end user.

Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6
Reviewed-on: https://code.wireshark.org/review/9602
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12 03:14:38 +00:00
Hannes Mezger e0deadcbc7 opcua dissector: fix display of service type in packet column
The loop was iterating using g_NumServices, which is the number of entries in g_arParserTable and not the number of entries in g_requesttypes. Instead now we use val_to_str which can in addition display the ServiceId instead if not found in the table.

Change-Id: If15ee5c460e07c4687464805935b92c913392011
Reviewed-on: https://code.wireshark.org/review/9459
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-08 18:33:39 +00:00
Peter Wu 7b33634cc5 plugins: add cleanup routines
Destroy the reassembly tables on exit, fix memleak in profinet
dissector.

Change-Id: Id34dbfde42fe715513997452f87cd4fdc328e294
Reviewed-on: https://code.wireshark.org/review/9229
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:38:46 +00:00
Hannes Mezger 051986ccf8 opcua dissector: Add DefaultXml encoding IDs
Currently only DefaultBinary encoding IDs can be displayed, this commit adds the DefaultXml encoding IDs

Change-Id: I19f3693d3aa03451655058770383222c3828b570
Reviewed-on: https://code.wireshark.org/review/9442
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-02 10:21:01 +00:00
Alexis La Goutte 9d8b810127 Lemon: Update lemon tools
Update from SQLite trunk (19 April 2015)

Add include <config.h>

Fix warning: unused parameter 'argc' [-Wunused-parameter] (using _U_)

Fix implicit conversion loses integer precision

Fix comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Fix function declaration isn’t a prototype [-Wstrict-prototypes]

Fix warning: old-style function definition [-Wold-style-definition]

Fix trailing whitespace

Fix use -T for template for epan\Makefile.nmake, epan\dfilter\Makefile.nmake, plugins\mate\Makefile.nmake, plugins\tpg\Makefile.nmake and cmake/modules/UseLemon.cmake

Fix -Wmissing-prototypes Remove unused function (acttab_free)

Add basename the filename with only filename (no path...)

Fix lemon.c:3435: warning: implicit conversion shortens 64-bit value into a 32-bit value

Add "new" version of lempar.c (3 November 2009).

LEMPAR: fix trailing whitespace

LEMPAR: fix -Wunused-parameter

Change-Id: I2df7e39c9a6846de26743a981fb76aca423fe813
Reviewed-on: https://code.wireshark.org/review/6502
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-02 08:49:02 +00:00
Hannes Mezger dc6d68c624 opcua dissector: Fix display of status code in error message
Instead of just displaying the hex representation, use parseStatusCode which adds the textual representation of the status code

Change-Id: I43b9ff846ef48d727e77cfa247b9dcea7061bbab
Reviewed-on: https://code.wireshark.org/review/9441
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-02 08:48:44 +00:00
Gerhard Gappmeier 9c7acde712 opcua dissector: Fix parsing of 7 byte numeric service NodeIds.
The service NodeIds of OPC UA are normally encoded as 4 byte numeric NodeId.
However, it is technically also possible to encode these as (less efficient) 7 byte numeric NodeId.
This kind of NodeId was already implemented, but wrong.
Since then no one ever used this kind of NodeId for service NodeIds.

Change-Id: I8654d969604e18bce8415931e455632e72d578ef
Reviewed-on: https://code.wireshark.org/review/9435
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-01 11:13:10 +00:00
Peter Wu a36db750e4 plugins/mate: fix some memleaks
Fixes about 5kB leaks in 500+ allocations.

There are still some other remaining (and not fixed in this patch
because it is hard to track them):

 - The g_strdup'ed memory via MATE_PARSE for some types (cannot simply
   g_free after use, it is still needed in some cases).
 - cfg->transforms and cfg->transport_ranges as used in pdu_decl
   (mate_grammar.lemon).

Tested on a http capture with: tshark -o mate.config:tcp.mate -r ...
where tcp.mate is from
https://wiki.wireshark.org/Mate/GettingStarted?action=AttachFile&do=get&target=tcp.mate

Change-Id: I4c06f948136fc30dfcdb56f7ac8a32a2326ae30d
Reviewed-on: https://code.wireshark.org/review/9221
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-29 22:56:21 +00:00
Peter Wu 3f5d183a44 Stop using atof/strtod (fixes column sorting of float types)
atof is locale-dependent. In locales such as Swedish, German and Dutch,
the dot is a thousand separator, resulting in wrong conversions for
floats.

While at it, make the mate dissector also be independent of locale.
Blacklist atof in checkAPIs. Lemon is still using strtod, but that is
not our problem for now.

Bug: 11297
Bug: 8964
Change-Id: I6fe3e45eb1d6d95d41aa4f3af1f81a6204a60c63
Reviewed-on: https://code.wireshark.org/review/9116
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 15:38:45 +00:00
Birol Capa 271d8e84c8 Profinet: I&M5 Data is added.
This optional attribute allows identifying separately orderable OEM parts used to built the device.
It consists of the following attributes:
Number Of Entries, IM Annotation, Vendor ID, IM Order ID, Serial Number, Hardware Revision, Software Revision

Change-Id: I793f6ecd798f93e7f40e8e1a42e42a7070a4a1c1
Reviewed-on: https://code.wireshark.org/review/8955
Reviewed-by: Alexis La Goutte <alexis.lagoutte@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>
2015-06-17 06:29:40 +00:00
Birol Capa 75ddc454f1 Profinet: Combined Object Container is added.
An IO device may define so called “combined objects”.
A particular combined object is a group of related submodules, e.g. an interface and its ports.
The Combined Object Container holds the parametrization for all submodules.

Change-Id: Ifb6c63d2c3a1d3cf2cf100a8f54cf0eafa84fe6c
Reviewed-on: https://code.wireshark.org/review/8853
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>
2015-06-15 12:33:26 +00:00
Peter Wu c11a912b6f icmp,wimax: Fix undefined shift
Fixes these warnings reported by Undefined Behavior Sanitizer (UBSan)
while running the test suite:

    icmp: left shift of 55099 by 16 places cannot be represented in type 'int'
    wimax: left shift of 1 by 31 places cannot be represented in type 'int'

Change-Id: I72913a901b61033098750da9c8f1617b055999a1
Reviewed-on: https://code.wireshark.org/review/8913
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-15 10:55:35 +00:00
Gerald Combs 845a832fac Print "and greater" instead of a ten digit number.
Change-Id: I97dfabe3ec48acf57b33ec15486d2d660d610f6d
Reviewed-on: https://code.wireshark.org/review/8841
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-08 16:05:11 +00:00
Birol Capa 09e3505701 Profinet: OEM Device ID is added
The Device ID of the OEM part may additionally be offered using OEM Device ID

Change-Id: Ic51cc4c05a41a8d18f265fb1abab739d1e82e28a
Reviewed-on: https://code.wireshark.org/review/8832
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-08 13:01:24 +00:00
Pascal Quantin 1ec868eddd Fix a few issues reported by PVS-Studio
See http://www.viva64.com/en/b/0328/ for details

Change-Id: Ic9ddfd690b49401c96cb8a4a277c671f9824be31
Reviewed-on: https://code.wireshark.org/review/8775
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-05 21:15:37 +00:00
Birol Capa 539418c917 Profinet: Add Fiber Optic Diagnosis Info.
This make reading fiber optic diagnosis data possible.

Change-Id: I90b49443ffa1b69912d37cbf7a751328eec9d590
Reviewed-on: https://code.wireshark.org/review/8750
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-04 12:15:19 +00:00
Thomas Wiens 28481cda01 ams: fixed wrong offset calculation, adsstate has 2 bytes
Change-Id: I95813bb49dd9a51662bac521e82599c26de59e8e
Reviewed-on: https://code.wireshark.org/review/8701
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-05-30 12:12:59 +00:00
Guy Harris 9fba5f0764 Fix some cases where we're shifting a signed 1 left.
Shift 1U instead, to make sure it's unsigned; the result of, for
example, the result of shifting a signed value left is undefined if the
value times 2^{shift count} doesn't fit in the *signed* type of the
shifted value.  That means, in particular, that the result of shifting 1
left by {number of bits in an int - 1} is undefined.  (In *practice*,
it'll probably be -2^32, with the bit you want set, but that's not
guaranteed, and GCC 5.1 seems not to like it.)

Change-Id: I0d27565c382a04ceda9eec65f45a430ceb74cf53
Reviewed-on: https://code.wireshark.org/review/8255
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-30 22:22:59 +00:00
Evan Huus b3caf8917c wimax: replace deprecated tvb_length calls
Change-Id: I9db1051e065762b826973ecbc2dba460a7f89013
Reviewed-on: https://code.wireshark.org/review/8123
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-20 06:38:00 +00:00
Graham Bloice e280df605f Fix CMake warnings
Newer versions of CMake generate warnings about the use of
@variable@ references, replace @CPACK_PACKAGE_NAME@ with
${CPACK_PACKAGE_NAME}

Set the policy for CMP0026 to be old to squelch warnings about the
use of target LOCATION

Change-Id: I424083260c51875dde80f98a23d6528c31ff0aec
Reviewed-on: https://code.wireshark.org/review/7977
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2015-04-17 16:09:22 +00:00
Evan Huus b23ab904e7 unistim: remove tvb_length deprecated API
Change-Id: Ic2bdc6ec69dcdd856987ec74cc401cd8585727ac
Reviewed-on: https://code.wireshark.org/review/7937
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-06 17:17:56 +00:00
Evan Huus 6efa0b63f2 profinet: remove tvb_length deprecated API
Change-Id: Ie6f607d86235c0e2d4fc95f77a7500c1636da934
Reviewed-on: https://code.wireshark.org/review/7936
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-06 17:17:52 +00:00
Evan Huus c1e6a19f27 ethercat: remove deprecated tvb_length API
Change-Id: I76916948fc06c5a4df5a1188fde164d516b4105d
Reviewed-on: https://code.wireshark.org/review/7938
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-06 17:17:47 +00:00
Evan Huus 4c5b53f044 docsis: remove tvb_length calls
Change-Id: Ib35c6436876aa7f933dcec0a97a70ccbbc823905
Reviewed-on: https://code.wireshark.org/review/7913
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-05 12:27:40 +00:00
Evan Huus 32d0fc0673 irda: remove tvb_length calls
Change-Id: I5ea9ed7226217ab272d957ae3240a286c6a26de9
Reviewed-on: https://code.wireshark.org/review/7912
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-05 12:27:34 +00:00
Pascal Quantin f292d761d5 Update Custom.nmake.example with the change done in g2ef72cb
Change-Id: I8d2dc7325da9cd573e87ac924feafe9b55f44a5f
Reviewed-on: https://code.wireshark.org/review/7682
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-14 19:34:32 +00:00
Gerald Combs 2ef72cb7aa CMake: Add a top-level nsis_package target.
Add packaging/nsis/CMakeLists.txt and use it to generate each NSIS include
file. Add macros to generate packaging-related targets and invoke them
from the top-level CMakeLists.txt.

Add a top-level "plugins" target. Copy plugins to "plugins" in each of
our staging directories instead of "plugins/$VERSION".

Add missing files to the copy_data_files and copy_cli_dlls targets.

Add all files in the NSIS package from the staging directory.

Drop a bunch of no-longer-needed defines, e.g. MSVC_VARIANT.

Change-Id: Ib1079260d164c65118050f1431af8e582cd577fa
Reviewed-on: https://code.wireshark.org/review/6459
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-12 22:47:42 +00:00
Guy Harris 499d95964d Eliminate e_uuid_t in favor of e_guid_t.
That eliminates a redundant and confusing data type, and avoids issues
with one piece of code using e_uuid_t but wanting to use routines
expecting an e_guid_t.

Change-Id: I95e172d46d342ab40f6254300ecbd2a0530cde60
Reviewed-on: https://code.wireshark.org/review/7506
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-03 10:55:29 +00:00
Peter Wu 48d376fbb2 plugins: fix dissector registration with CMake
Noticed when comparing output of `tshark -G fields` between autofoo and
cmake builds. With this change, I see no differences anymore.

While only WiMax needs this change, do a similar thing for consistency
with autofoo and between dissectors (actually, the contents of
${PLUGIN_FILES} minus plugin.c was used).

Change-Id: Ib61f69dcc0b8eda713da931b6cc3e946848bea9d
Reviewed-on: https://code.wireshark.org/review/7462
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-03-03 01:44:35 +00:00
Michael Mann 9c55903029 Use COPY_ADDRESS_SHALLOW instead of duplicating TVB_SET_ADDRESS and SET_ADDRESS calls for the same address.
Change-Id: I0c9cc5d574fdd73ecf1f8b32dbbf0ddb2b885116
Reviewed-on: https://code.wireshark.org/review/7437
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-01 12:54:33 +00:00
Guy Harris 8c86fbc0be <string.h>, not <memory.h>, is the header file for memcpy().
Don't include <memory.h> when using memcpy(), include <string.h>.

We don't need to check for memory.h, so don't do it in CMake (we don't
explicitly check for it in autoconf, but it's checked for by some macro
we do use).

Change-Id: I7aa93d4ea93bab9beff597939d3c24aecda3d52e
Reviewed-on: https://code.wireshark.org/review/7433
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-27 22:55:53 +00:00
Michael Mann 8d5da72ff9 Add tvb_address_with_resolution_to_str.
Convert dissectors to using the API where appropriate.

Change-Id: I059582f73a75635d4a0338d02d4c4b212162480b
Reviewed-on: https://code.wireshark.org/review/7296
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-22 02:53:48 +00:00
Guy Harris 859511db14 Make UAT record update callbacks return a success/failure indication.
Have them return TRUE on success and FALSE on failure.  Check the return
value rather than whether the error string pointer is null or not.

Change-Id: I800a03bcd70a6bbb7b217cf7c4800e9cdcf2189c
Reviewed-on: https://code.wireshark.org/review/7222
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-18 00:41:09 +00:00
Gerald Combs ad6d259e1e EtherCAT: Suppress pedantic warnings.
Try to suppress

warning: type of bit-field 'foo' is a GCC extension [-Wpedantic]

Change-Id: If161a509db2d6aaad3bb656318902f0bc7b0d0a9
Reviewed-on: https://code.wireshark.org/review/7136
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-15 19:44:14 +00:00
Pascal Quantin ef21740e25 Gryphon: do not use col_set_str with non constant strings
Fixes an ASAN failure reported by Alexis

Change-Id: I68e5c55ec4090766ef5f003f44093ce3c268a82a
Reviewed-on: https://code.wireshark.org/review/7082
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-12 15:19:03 +00:00
Martin Mathieson 88d62dffe8 Remove unneeded includes from plugins folder
Change-Id: Ifdad0fb786a97a6f84a64d442fcca0c20116552f
Reviewed-on: https://code.wireshark.org/review/7059
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-02-10 17:53:28 +00:00
Bill Meier e88a11f5c9 (Trivial) Fix printf-related 'Mismatch on sign' warnings
Found by MSVC2013 Code Analysis

Change-Id: I58063946dd558e98308c87b36eeac0ddbe1a6e79
Reviewed-on: https://code.wireshark.org/review/7045
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-09 18:57:14 +00:00
Michael Mann 2875cd382f Eliminate the hf member out of the address structure.
Using the new address type registration, dissectors can create their own address types with their own (column) filters attached to them, eliminating the need for an address to keep track of a hf_ field.

Change-Id: I2bbec256a056f403a7ac9880d5d76a0b2a21b221
Ping-Bug: 7728
Reviewed-on: https://code.wireshark.org/review/7037
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-09 03:48:53 +00:00
Evan Huus 2bcd38fec4 ethercat: add default case in FoeFormatter
Should probably fix an unintialized memory access caught by valgrind, although I
can't reproduce it because out-of-tree plugins are still broken.

Bug: 10919
Change-Id: Ib8c46e13922f25260ca0e8886368f5ce24e3d0b0
Reviewed-on: https://code.wireshark.org/review/6962
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-05 08:51:44 +00:00
Alexis La Goutte 7dfda8875a WIMAX: fix no previous prototype for ... [-Wmissing-prototypes]
Also comment the unused function wimax_decode_sub_dl_ul_map

Part 2...

Change-Id: I1836aa2851156e4f756c5697f86a142625d697c9
Reviewed-on: https://code.wireshark.org/review/6810
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27 15:31:57 +00:00
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus()
to make TCP-based dissection easier.

Bug: 9851
Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3
Reviewed-on: https://code.wireshark.org/review/6778
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-27 15:14:12 +00:00
Gerald Combs 6e6a1291d0 CMake: Set an output directory for plugins.
Redefine PLUGIN_DIR similar to DATAFILE_DIR and use it on all
platforms. Add WiresharkPlugin.cmake so that we can start defining common
macros for plugins/*/CMakeLists.txt. Load plugins in out-of-tree builds.

Change-Id: I8c1359ed3cf8a71788b8320ff89dfe2d3969def2
Reviewed-on: https://code.wireshark.org/review/6640
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-20 16:12:20 +00:00
Guy Harris 233dc643a6 Remove some apparently-unnecessary includes of emem.h.
Change-Id: Id50ce3e707056cca8f30052f05c451ce431b39b5
Reviewed-on: https://code.wireshark.org/review/6632
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 19:36:36 +00:00
Michael Mann 77dac91eb0 A few more emem replacements with wmem.
Change-Id: Icfb319fba937642db637a7f26b5e7627461df3b0
Reviewed-on: https://code.wireshark.org/review/6590
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17 21:05:58 +00:00
Alexis La Goutte d9ec8abaf8 mate_util: fix parameter ... not found in the function declaration [-Wdocumentation]
Change-Id: I66af53ee06866b45339814b5fa949551c0dd45c1
Reviewed-on: https://code.wireshark.org/review/6535
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-15 05:38:04 +00:00
Guy Harris 63a3d043e3 Consistently use the "g_string_free returns a C string pointer" idiom.
g_string_free(str, FALSE) frees the GString container but not the
underlying g_malloc()ed string; instead, it returns a pointer to the
g_malloc()ed string.

Fix those places that didn't already get the string pointer from
g_string_free() to do so rather than manually extracting the string
themselves.

And fix one place that didn't even need to use a string - it was just
scanning a C string without even modifying it.

Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5
Reviewed-on: https://code.wireshark.org/review/6532
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 23:14:13 +00:00
Guy Harris bc23f79729 UAT error string pointers should not be const pointers.
UAT error strings are usually allocated by g_strdup() or
g_strdup_printf(), and must ultimately be freed by the caller.

Make the pointer-to-error-string-pointer arguments to various functions
be "char **", not "const char **".

Fix cases that finds where a raw string was being used, as that won't
work if you try to free it; g_strdup() it instead.

Add a missing free of an error string.

Remove some no-longer-necessary casts.

Remove some unnecessary g_strdup()s (the string being handed to it was
already g_malloc()ated).

Change some variable declarations to match.

Put in XXX comments for some cases where the error string is just freed,
without being shown to the user.

Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0
Reviewed-on: https://code.wireshark.org/review/6525
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 20:20:03 +00:00
Michael Mann 7967ef9510 Remove emem APIs from UAT functionality.
Change-Id: I009c09f25d170e5c9aaaef713eaacb3252817856
Reviewed-on: https://code.wireshark.org/review/6460
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-12 14:25:12 +00:00
Alexis La Goutte e974a6f571 msg_rng_rsp (Wimax): fix Copy-paste error (CID 11158604)
Change-Id: I134d8178d741d741404963a89f60e1d1bfd9a2dd
Reviewed-on: https://code.wireshark.org/review/6473
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-12 05:26:15 +00:00
Graham Bloice 528a857258 Fix CMake generation and use of Windows .rc files
CMake now generates local copies of .rc files for all the Windows
components and uses the files in the build of the components.

The .rc.in files that include an icon were modified to allow the icon
path to be set by CMake.  The path is removed for nmake builds.

Updated build architecture detection, required for wireshark.manifest.in

Change-Id: I7b1ff43050e9b0efb861d1041636fb4aef49a4f8
Reviewed-on: https://code.wireshark.org/review/6482
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2015-01-11 20:22:32 +00:00
Pascal Quantin 7d004dc887 Revert "Lemon: Update lemon tools"
This reverts commit 5855dd8d53.

This Lemon update fails to compile on OSX and triggers asserts on other platforms

Change-Id: I12a8a2bf32db31e5a9b0cb1a67a39724e30f3e91
Reviewed-on: https://code.wireshark.org/review/6496
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-11 19:57:45 +00:00
Alexis La Goutte 5855dd8d53 Lemon: Update lemon tools
Fix warning: declaration shadows a variable in the global scope [-Wshadow]

Add include <config.h>

Fix warning: unused parameter 'argc' [-Wunused-parameter] (using _U_)

Fix implicit conversion loses integer precision

Fix comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Fix function declaration isn’t a prototype [-Wstrict-prototypes]

Fix warning: old-style function definition [-Wold-style-definition]

Fix trailing whitespace

Fix use -T for template for epan\Makefile.nmake, epan\dfilter\Makefile.nmake, plugins\mate\Makefile.nmake, plugins\tpg\Makefile.nmake and cmake/modules/UseLemon.cmake

Fix -Wmissing-prototypes

Remove unused function (acttab_free)

Add basename the filename with only filename (no path...)

Change-Id: Ia79f61e29f828575df61cc89134c6c553044e86d
Reviewed-on: https://code.wireshark.org/review/3976
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-11 18:56:08 +00:00
Alexis La Goutte 37e64d83cd Unistim: Nesting level does not match indendation (CID 1159216)
Change-Id: I024f47a41328ea7e8db3c79012b892f3cb48caad
Reviewed-on: https://code.wireshark.org/review/6376
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 09:20:05 +00:00
Michael Mann cff098e3eb guid_to_ep_str -> guid_to_str
guid_to_str now uses wmem allocation.

Change-Id: I8e48d1a720942fbefbaa6227ae0929cb9f856359
Reviewed-on: https://code.wireshark.org/review/6391
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 07:18:09 +00:00
Bill Meier d245f38c12 packet-irda.c: Add editor modelines
Change-Id: I626b60a185e750af94306892cd41dc8729920cfd
Reviewed-on: https://code.wireshark.org/review/6393
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-08 01:52:56 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
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>
2015-01-06 07:38:18 +00:00
Anish Bhatt 124272ec09 [PROFINET] v2: Fix swapped MaintenanceRequired & MaintenanceDemanded bits
Fix the correct code path this time.
Bug: 10753

Change-Id: I7bc2e74c91868986303e8b41b25e43a665be1860
Reviewed-on: https://code.wireshark.org/review/6335
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-06 07:02:21 +00:00
Anish Bhatt eb98b04ac1 Revert "[PROFINET] Fix swapped MaintenanceRequired & MaintenanceDemanded bits"
This reverts commit 0452f763fb. Changes should
have been made in ChannelProperties instead of Submodule state. Current
implementation merely *appears* to be correct as we are reading it as a two bit
value but instead should be addressing it as individual bits, little endian
Bug: 10753

Change-Id: Ia3bd088aeb376b8511d64352f62c4304e4129ba6
Reviewed-on: https://code.wireshark.org/review/6334
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-06 07:02:07 +00:00
Alexis La Goutte 9a7318a184 Wimax: fix no previous prototype for ... [-Wmissing-prototypes]
Change-Id: I1dac7d362bab680c313766de19d51132d1ce6dfa
Reviewed-on: https://code.wireshark.org/review/6298
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-05 12:46:26 +00:00
Pascal Quantin 4a94374f4e Fix linkage on Windows machine
Change-Id: I24c8670fdf0910c3324fcfa8db8a8dbaad1dfbba
Reviewed-on: https://code.wireshark.org/review/6305
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-04 17:34:33 +00:00
Michael Mann 553da37446 Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field type.
These "bases" will put a ".", "-", or ":" respectively between hexidecimal bytes in the field in packet view and display filter.  FT_BYTES with BASE_NONE will have no separator in the packet view, but continue to have the ':' as a separator in the display filter.

Converted the "string" hf_ entries that used tvb_fc_to_str as a string to use proto_tree_add_item with FT_BYTES/BASE_DOT type.

Converted applicable tvb_bytes_to_ep_str_punct() calls to use the new BASE values.

Change-Id: I2442185bb314d04a3ff2ba57883652ecd738b5f9
Reviewed-on: https://code.wireshark.org/review/6098
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04 16:32:03 +00:00
Alexis La Goutte dbcb0b5ca0 stats tree plugin: fix no previous prototype for 'plugin_register_tap_listener' [-Wmissing-prototypes]
Change-Id: If8ea78b9aceb9dbd7f2103aa141b57715188ff4f
Reviewed-on: https://code.wireshark.org/review/6297
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04 14:00:19 +00:00
Anish Bhatt 0452f763fb [PROFINET] Fix swapped MaintenanceRequired & MaintenanceDemanded bits
Bug: 10753

Change-Id: Ib5522eba5c1d9107219ee2d70c96899ba6f22ca1
Reviewed-on: https://code.wireshark.org/review/6258
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-03 18:04:11 +00:00
Bill Meier 5c529c95c5 Add '*.nativecodeanalysis.xml' to 'clean' targets
Change-Id: I90dbf0b31fc737150a01533763a7869b34c68cb6
Reviewed-on: https://code.wireshark.org/review/6220
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-02 01:45:16 +00:00
Guy Harris a4019a357b Rename a variable to avoid a compiler warning.
(Thanks, IBM and AT&T.)

Change-Id: Ifcffd4937f90ca466c01ebc4f3e3bd8555a9b078
Reviewed-on: https://code.wireshark.org/review/6198
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-01 05:03:45 +00:00
Michael Mann 889c566b9a Eliminate proto_tree_add_text from WiMax plugin.
Most of this was done with a custom perl script that picked out the field names from the XBIT macro and generated an hf_ and filter (that was humanly tweaked from there).

Change-Id: I563db9f8ea216efe37322b784ab0daf25c038d9e
Reviewed-on: https://code.wireshark.org/review/6149
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>
2015-01-01 04:34:44 +00:00
Michael Mann 4eeb440b70 Remove proto_tree_add_text from packet-dcerpc-pn-io.c
Change-Id: Ia144061dc8c394d9ae89135009d06457e2aabb7d
Reviewed-on: https://code.wireshark.org/review/6152
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-31 00:28:38 +00:00
Alexis La Goutte 0fb4cdb36a Wimaxasncp: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ie2808d20a7f8e28bfe9b929b1b222a901a29f510
Reviewed-on: https://code.wireshark.org/review/6120
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-29 20:14:27 +00:00
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Pascal Quantin a2beef95db Fix assertion when applying conversation color
Packet scoped memory cannot be used here; let's use the pinfo pool

Change-Id: If76605f7a3021f5900fd46ce7d1c642a518c902f
Reviewed-on: https://code.wireshark.org/review/6061
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-26 22:18:09 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00
Alexis La Goutte c670adc677 DOCSIS: missing break in switch (CID 280485 & 280486)
Change-Id: I5b756b96ca6c3c48a43948d456bfcb07aab527fd
Reviewed-on: https://code.wireshark.org/review/5994
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-23 13:58:37 +00:00
Alexis La Goutte 5248c0df21 Fix unknown command tag name [-Wdocumentation-unknown-command]
Change-Id: I6c2564a86e13d9321001856ba1f51681a9f20976
Reviewed-on: https://code.wireshark.org/review/5979
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-22 15:24:28 +00:00
Bill Meier 998a84774b plugins: Cleanup #includes
Change-Id: Ic839f2995532d68308f8b5908c185acc7acaaa9c
Mostly: remove '#include <glib/glib.h>' and certain
         other #includes already included in packet.h
Reviewed-on: https://code.wireshark.org/review/5971
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-22 05:00:20 +00:00
Michael Mann f002332d88 Replace ether_to_str with either address_to_str or tvb_ether_to_str.
Change-Id: I8cce9fddbfe950e27e96ea8a5a6d2e0921ff4260
Reviewed-on: https://code.wireshark.org/review/5933
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: Michael Mann <mmann78@netscape.net>
2014-12-21 15:13:30 +00:00
Guy Harris 2b006ad30e Have a heur_dissector_list_t be an opaque handle.
This allows dissector lists to be looked up by name, so they can be
shared by multiple dissectors.

(This means that there's no "udplite" heuristic dissector list, but
there shouldn't be one - protocols can run atop UDP or UDPLite equally
well, and they share a port namespace and uint dissector table, so they
should share a heuristic dissector table as well.)

Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7
Reviewed-on: https://code.wireshark.org/review/5936
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21 04:14:24 +00:00
Michael Mann cadf1a5fce Remove profinet_type from packet_info structure.
Profinet I/O and DCOM CBA had completely separate uses for the profinet_type member, so it's okay to separate them with different proto ids tracking the proto_data.

Change-Id: I7b9c01b8d4f74d51fe9f9ef2f957479dff0a7157
Reviewed-on: https://code.wireshark.org/review/5852
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21 01:57:51 +00:00
Michael Mann 1f031808e1 Use new color_dissector_filters.[ch] to refactor (color) conversation generation in GTK menus.
Change-Id: I5868a40b71a989a3a1522cb091064bb0aaec6daf
Reviewed-on: https://code.wireshark.org/review/5828
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>
2014-12-19 07:59:28 +00:00
Bill Meier 5992ef414e plugins: replace ENC_NA by ENC_..._ENDIAN when fetching integral types
Change-Id: I3958bbd0eadd4472a003ea272e596026ad8731d1
Reviewed-on: https://code.wireshark.org/review/5753
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 21:59:25 +00:00
Michael Mann a971768530 Refactor "color" conversation filters
Have dissectors register their desire to be part of "color" conversation filters and have the GUI use that registered list.  GUI actually using API will come in a separate commit.

Change-Id: I5ffe922d97894fe7bf3182056b76ab5839a9461a
Reviewed-on: https://code.wireshark.org/review/5658
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-10 09:04:00 +00:00
Hannes Mezger 0bd79c548e Fix full name of NodeId namespace index field, was a copy&pase error
Change-Id: I7b1eea9965880e35c65f04406ff756d245b568d4
Reviewed-on: https://code.wireshark.org/review/5668
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-12-08 10:43:43 +00:00
Bill Meier c681091a2a Fix instances of duplicate display-filter-names with incompatible types.
Change-Id: I3b5afb8a59f6443624708b9fecfdcbe93dad59ef
Note: Some of the filters, when/if used, could have caused Wireshark crashes.
Reviewed-on: https://code.wireshark.org/review/5575
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-02 22:40:26 +00:00
Michael Mann 6d207fe5f4 Remove private_data member from packet_info structure.
Dissectors should pass data directly to their subdissectors through the data parameter (of new-style dissectors). This avoids unintentional "trampling" from other dissectors trying to "share" private_data member.

Change-Id: I2efef5c8dfeef64588ba3ac6e695b469238c6468
Reviewed-on: https://code.wireshark.org/review/5487
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-01 14:05:44 +00:00
Bill Meier e39938256b Rename some hf[] display filter names to fix dups.
Change-Id: Ibe932bc37e03194f1801ec4eed4da1ff31370de3
Reviewed-on: https://code.wireshark.org/review/5535
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-29 22:08:12 +00:00
Bill Meier 44693468b2 Fix a number of dup hf[] filter-names probably mostly resulting from cut/paste errs
Change-Id: Id658b9e1803b2f5b92e711a3ce981ff602333d98
Reviewed-on: https://code.wireshark.org/review/5513
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-27 01:44:00 +00:00
Alexis La Goutte 605a6aece2 Mate: Fix indent (use tabs)
Change-Id: I9a02e4a063dc4fc173ff9b7596acd7f9ceba7aa7
Reviewed-on: https://code.wireshark.org/review/5477
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-24 22:00:39 +00:00
Michael Mann daed8070dd Pass FrameID as data to the heuristic table, rather than use pinfo->private_data.
Change-Id: Idd5818cbb2b1f8628bb29c2c71dfc6d41df89b5d
Reviewed-on: https://code.wireshark.org/review/5448
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-24 14:35:42 +00:00
Michael Mann e50095c600 Remove use of pinfo->private_data (which doesn't appear to be used anyway) and pass it as dissector data.
Some other minor cleanup while in the neighborhood.

Change-Id: I1b0c0567488fa350c14d21c5f5e4cb9746177af1
Reviewed-on: https://code.wireshark.org/review/5447
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-23 05:13:52 +00:00
Pascal Quantin f7f19f0291 IrDA: always initialize buffer before accessing it
Bug: 10716
Change-Id: I8e54f750b70076758d5fd0d7f35f9c782f5d0bf9
Reviewed-on: https://code.wireshark.org/review/5398
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-11-20 12:28:29 +00:00
Michael Mann c62dac1a77 Eliminate proto_tree_add_text from packet-mate.c
Change-Id: I3f4b3eb23b91b219df373b3012fbefa63abfa4d3
Reviewed-on: https://code.wireshark.org/review/5350
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-19 12:47:06 +00:00
Michael Mann bea106c79f Eliminate proto_tree_add_text
Also some other cleanup to simplify dissector logic.

Change-Id: Ia84300b7eadafe292361014dd0e565ec250cae44
Reviewed-on: https://code.wireshark.org/review/5311
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>
2014-11-17 07:40:20 +00:00
Michael Mann 57b72275b7 Eliminate proto_tree_add_text by formatting field hf_opcua_ByteString in a few places.
Change-Id: I9606aa36b7d7b6bb2ef2e7685e6629163ca83ef7
Reviewed-on: https://code.wireshark.org/review/5312
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: Evan Huus <eapache@gmail.com>
2014-11-17 01:04:57 +00:00
Michael Mann 62fd2acc96 Eliminate proto_tree_add_text from some plugin dissector files.
Change-Id: Ib2d900833a8763307be6b1cfc8df20d7019d2706
Reviewed-on: https://code.wireshark.org/review/5313
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-15 00:41:10 +00:00
Michael Mann 0ce3640cab Replace pinfo->circuit_id will passing data through functions.
Change-Id: I5b35ad57c5c40a1393cbc174384b8a275abd763c
Reviewed-on: https://code.wireshark.org/review/4903
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-22 05:00:19 +00:00
Guy Harris 9eb0080e05 Sign, Flex strikes again; it generates code that produces warnings.
Change-Id: Ibd92bd07e537a4ac19e2a5b159ece0e25aa366b1
Reviewed-on: https://code.wireshark.org/review/4861
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-20 08:09:04 +00:00
Guy Harris c9b84a5cca This appears to be clean with my build; see if it needs work with others.
Change-Id: I2c3e3ce8e29b26958d42b66eca3c7539b65695ab
Reviewed-on: https://code.wireshark.org/review/4848
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-19 23:09:20 +00:00
Guy Harris 4d6b3db5d4 Eliminate a use of a ctype.h function.
That way, we avoid locale-dependent behavior.

Change-Id: I429fde961dc7cb61013756a663d6cd511f19ca70
Reviewed-on: https://code.wireshark.org/review/4845
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-19 23:01:15 +00:00
Hannes Mezger 85e7c15605 Use proto_tree_add_expert_format instead of proto_tree_add_text
Change-Id: Ia017fa9535cbc7570ce6bd442972eedd2143825a
Reviewed-on: https://code.wireshark.org/review/4729
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-18 12:29:50 +00:00
Hannes Mezger 35a9b98138 Use proto_tree_add_bitmask for ExpandedNodeId EncodingMask
Instead of adding the items using proto_tree_add_item, use proto_tree_add_bitmask in parseExpandedNodeId(). Also, the redundant 'NodeId ' text is removed from hf_opcua_nodeid_... items for better readability.

Change-Id: Ie68f1d280dd733fd2eede0b2b73ad8d7f28396b3
Reviewed-on: https://code.wireshark.org/review/4730
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-17 16:04:09 +00:00
Hannes Mezger e5bbfa0f15 Add argument 'packet_info *pinfo' to all dissecting functions
Change-Id: Ie02326e365ee3f620fcbe3f2e8e45dc5300d3418
Reviewed-on: https://code.wireshark.org/review/4728
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-17 14:51:40 +00:00
Hannes Mezger 381966b6c4 Replace proto_tree_add_text in non-generated files
As requested by Michael Mann, most of the occurences of proto_tree_add_text/proto_item_add_subtree are replaced with proto_tree_add_subtree(_format) or proto_tree_add_item/proto_item_append_text in the non-generated files.

Change-Id: I27cccde88780adef43c78efd26333f47af098ad6
Reviewed-on: https://code.wireshark.org/review/4726
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-16 16:55:47 +00:00