aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2014-12-30Test suite: Start testing our output for valid UTF-8.Gerald Combs2-0/+22
Feed the output of `tshark -G <glossary>` to `iconv -f UTF-8`. Adjust a couple of the Bluetooth dissectors and X11 keysyms accordingly. Change-Id: I5b04dc3fa4734c8f0a795daf44bd398fe5ebc1bd Reviewed-on: https://code.wireshark.org/review/6146 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-25Bug 10233 - Wireshark crashes if Lua heuristic dissector returns trueHadriel Kaplan1-28/+155
Because call_heur_dissector_direct() didn't set the pinfo->heur_list_name before calling the heuristic dissector, heur_dissect_lua() would invoke report_failure(). Unfortunately, calling report_failure() within a dissector can cause problems because GTK continues invoking timed callbacks while it displays the modal dialog created by report_failure()... without yet returning from report_failure(). In such a case, it's possible for epan_dissect_run() to be called while still within the execution of a previous call to epan_dissect_run(), which casues an assert since epan_dissect_run() is not reentrant. So this commit both fixes the call_heur_dissector_direct() bug as well as avoids using report_failure() within heur_dissect_lua(). It also upadtes the dissector.lua script used in the testsuite to match the one pubshied on the wiki, since that script's heuristic dissector triggered the bug. Bug: 10233 Change-Id: If022604347745fadac01c02d370ca1a5d3f88b5b Reviewed-on: https://code.wireshark.org/review/6040 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> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-24test suite: (Minor) fix some double spaceAlexis La Goutte2-4/+4
Change-Id: I7fe7cd7ed471b8fcd2afd5fb4bbc180b580295b3 Reviewed-on: https://code.wireshark.org/review/6031 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-23test suite: fix indent (use tabs) and add modelinesAlexis La Goutte3-50/+61
Change-Id: I648d02d41f92c7fd176ce194eee20a2d19643fe0 Reviewed-on: https://code.wireshark.org/review/5985 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-01Remove private_data member from packet_info structure.Michael Mann1-2/+0
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-10-08Try to speed up ping-dependent capture tests.Gerald Combs1-9/+14
Ping four times a second for ~60 seconds. Save the subprocess PID so that we can kill it when we're done with each test instead of waiting for it to finish. Change-Id: I64f889c700e8a6fa1bc1c3916ef045341ef59cc6 Reviewed-on: https://code.wireshark.org/review/4557 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-03Re-enable the Wireshark test suite.Gerald Combs1-1/+1
Change-Id: Icfd9edb8c6ef7620878bc9d60c8dcc569ad2abad Reviewed-on: https://code.wireshark.org/review/4434 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-02Partially re-enable Wireshark tests.Gerald Combs2-3/+6
Qt requires Xrender and XKEYBOARD. Unfortunately the Ubuntu and Solaris buildbots run the test script under Xtightvnc, which provides neither of those. Only enable the tests on Windows and OS X for now. Change-Id: I84bc28f810782b862b4dca8fc8df088a4919066d Reviewed-on: https://code.wireshark.org/review/4430 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-02Temporarily disable the Qt tests added in g58cde5c.Gerald Combs2-2/+2
Apparently what works for me doesn't work for the Buildbot users. Change-Id: I7d3e4f2b89ae8ae3dadc8d92438c0e1923b97ace Reviewed-on: https://code.wireshark.org/review/4416 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-01Add tests for the Qt UI.Gerald Combs4-4/+43
Make sure the Qt UI quits if WIRESHARK_QUIT_AFTER_CAPTURE is set. Make sure Bourne shell scripts (*.sh) have UNIX/POSIX line endings. Reduce some time values so that the tests run faster. Change-Id: I81df7c6f72d7d807d1856863cbea1bb6326ca711 Reviewed-on: https://code.wireshark.org/review/4407 Tested-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-29Fix lua bindings to handle timestamp precision changesEvan Huus1-1/+1
The recent wiretap changes broke the generation of init.lua among other things, though it did coincidentally fix one of the "yuck" comments in the generator regex. (Note that this is entirely untested, because out-of-tree init.lua is and always has been broken, but it should work) Change-Id: Id0c27b31c596613997de4ba2f6088eb9d6c8fc53 Reviewed-on: https://code.wireshark.org/review/4361 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-24test: add decryption test for isakmp with certificatesAlex Badea3-0/+19
This was suggested in review 2297. Capture and key are from bug 7951. Bug: 7951 Change-Id: I820c5e839b20ec464cc1be438633d5311f657fb2 Signed-off-by: Alex Badea <abadea@ixiacom.com> Reviewed-on: https://code.wireshark.org/review/4143 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-02Qt → wireshark. GTK+ → wireshark-gtk.Gerald Combs4-8/+8
Make sure the Qt UI is named "Wireshark" and its executable is named "wireshark" or "wireshark.exe". Make sure the GTK+ UI is named "Wireshark 1" or "Wireshark (GTK+)" depending on how much the target audience is likely to care about UI toolkits. Make sure the GTK+ executable is named "wireshark-gtk" or "wireshark-gtk.exe". It looks like moving to Qt 5.3 (g978faf3) broke the PortableApps package. It's likely even more broken now. Autotools out-of-tree builds also broke on Ubuntu 12.02 (automake 1.11.3) at some point. The first attempt to compile in ui/qt returns "error: source_file.cpp: No such file or directory". The second attempt works. Out-of-tree builds work fine on Ubuntu 14.04 (automake 1.14.1). Tested: - Nmake builds - NSIS packaging - CMake builds (Windows, OS X) - Autotools build and distcheck - RPM packaging To do: - Test Debian packaging - Fix PortableApps Change-Id: I66429870e05fd2d6fc901942477959ed6164fce2 Reviewed-on: https://code.wireshark.org/review/3919 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-12make unit-test suite work out-of-treeEvan Huus1-5/+15
Change-Id: I638015a9b55712bb6843d6756c9c55915e142372 Reviewed-on: https://code.wireshark.org/review/2893 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-27Tighten the dump-glossary test.Evan Huus1-1/+4
1. The only indication we get of an out-of-order value string is a message on STDERR, so check that and fail the test if STDERR wasn't empty. 2. This exposes an out-of-order value string in packet-stun.c; fix it. 3. This triggered the pre-commit hook on packet-stun.c, which noticed an API error (ENC_ASCII -> ENC_ASCII|ENC_NA); fix that too. Change-Id: I36f87a2a87b40537119562f22a7e3012716ff239 Lesson: automated testing/tooling is both wonderful and scary. Reviewed-on: https://code.wireshark.org/review/2682 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-25Decrease TRAFFIC_CAPTURE_DURATION from 60s to 15s.Gerald Combs1-1/+1
Change-Id: Ie6d6ac0489f0fcb506360a3900d33c44cb3477e9 Reviewed-on: https://code.wireshark.org/review/2664 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-18Check for lua by grepping the output of tshark -vEvan Huus1-2/+2
Grepping config.h doesn't work for out-of-tree builds. Change-Id: If3f551dffb04dd646f5adece57fac90dc48ff1c9 Reviewed-on: https://code.wireshark.org/review/2389 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-24Allow wtap_read() and wtap_seek_read() to return records other than packets.Guy Harris2-2/+5
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-21Fix lua directory tests.Evan Huus1-14/+16
The underlying directory iterator is not guaranteed to return directories in the same order according to the glib documentation, so don't rely on the directory order being the same when testing it. https://developer.gnome.org/glib/2.37/glib-File-Utilities.html#g-dir-read-name Bug:10009 Change-Id: I4b1078e1f3981921b1e83c4f77b4bc30a5d21b46 Reviewed-on: https://code.wireshark.org/review/1671 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-27Revert part of g757db64e484b009c3Evan Huus1-1/+1
It was intended to change the DTLS decryption test, but changed the SSL test file instead, which led to the SSL test mysteriously failing. The SSL capture really is http, so that's the right protocol, and the port is the standard 443, not 4433 (which was perhaps a typo?). Change-Id: I84448c2326d2a4301a4bba9607f8ba90a495531d Reviewed-on: https://code.wireshark.org/review/1401 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-26Have DTLS just dissect the test capture as dataEvan Huus1-1/+1
Follow-up to g757db64e484b009c33b67b5fa38e109d7b8f5e78 which changed the filter being tested but didn't change the target protocol, so the test was still failing because it was still trying to use HTTP. Change-Id: I6675cfad3bba63f7a536eb7ae82e4b25132d108e Reviewed-on: https://code.wireshark.org/review/1375 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-25Don't use HTTP filter for DTLS decryption test as it's not really HTTP ↵Michael Mann2-2/+2
traffic (and a more discerning HTTP dissector will cause this to fail) Change-Id: I74ea78f541f87000d84c85794d04e9de46d477f2 Reviewed-on: https://code.wireshark.org/review/1333 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-17Add tvb_get and proto_tree_add for string-encoded byte arraysHadriel Kaplan2-25/+246
This commit adds tvb_get_string_bytes and proto_tree_add_bytes_item routines for getting GByteArrays fields from the tvb when they are encoded in ASCII hex string form. The proto_tree_add_bytes_item routine is also usable for normal binary encoded byte arrays, and has the advantage of retrieving the array values even if there's no proto tree. It also exposes the routines to Lua, both so that a Lua script can take advantage of this, but also so I can write a testsuite to test the functions. Change-Id: I112a038653df6482a5d0ebe7c95708f207319e20 Reviewed-on: https://code.wireshark.org/review/1158 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14Add tvb_get and proto_tree_add for string-encoded timestampsHadriel Kaplan2-0/+599
This commit adds tvb_get_string_time and proto_tree_add_time_item routines for getting nstime fields from the tvb when they are encoded in ASCII string form. The proto_tree_add_time_item routine is also usable for normal big/little-endian encoded time_t, and has the advantage of retrieving the value even if there's no proto tree. It also exposes the routines to Lua, both so that a Lua script can take advantage of this, but also so I can write a testsuite to test the functions. Change-Id: I955da10f68f2680e3da3a5be5ad8fdce7ed6808c Reviewed-on: https://code.wireshark.org/review/1084 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-07Switch to Lua 5.2.3 built with MSVC2010 instead of the one built with MingW ↵Pascal Quantin1-7/+7
gcc 4.3 Fixes bug 9957 Change-Id: Ibe38ec25be5cfdad98c53c8257b0a858529897f6 Reviewed-on: https://code.wireshark.org/review/991 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-06Get it compiling again: WindowsXP build failingHadriel Kaplan1-7/+7
The WindowsXP build is failing due to a wslua testsuite failure, in the file reader/writer tests. I've looked at it a bit and I don't know why it's failing yet - I know why it says it's failing, but it doesn't fail for me. And it was passing on WindowsXP until the change to Lua 5.2.3, but I run 5.2.3 all the time and it passes for me, and there's nothing special about the portion that's failing. The only way to debug it is to run it on WindowsXP myself, but I need a build to do that with, so I've commented out the failing test and hopefull it will build now and I can grab the automated build to debug the issue. Change-Id: Ib75e8f75829e8f506823e648605ba16e21c7973a Reviewed-on: https://code.wireshark.org/review/982 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte14-25/+0
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash) Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd Reviewed-on: https://code.wireshark.org/review/881 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^\$Id\$/,+1 d') (No space or star before $Id$) Change-Id: I0801bd7cf234d32487008a8b6dcee64875b07688 Reviewed-on: https://code.wireshark.org/review/876 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-26Add various functions for Lua directory handling and path infoHadriel Kaplan2-0/+219
This adds new functions to get plugins path info, find out if a directory exists, make a new one, remove one, etc. It also creates a file environment for user-supplied Lua scripts, to prevent global variable contamination as well as supply the script-specific file name. Some other minor cleanup was done as I found them. A new testsuite was added to test the existing and new directory functions. Change-Id: I19bd587b5e8a73d89b8521af73670e023314fb33 Reviewed-on: https://code.wireshark.org/review/832 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-26Add filterable expert info for LuaHadriel Kaplan4-9/+137
This adds the ability for a Lua script to register expert info fields, similar to C-code dissectors. This change also removes the need for the expert_add_info_format_internal() function. Existing Lua scripts do not have to change, because the existing expert info function uses the internal "_ws.lua" protocol instead of nothing; but using the new functionality provides more benefits since it correctly registers the expert info fields to the dissector's protocol. The test suite was amended to generate both old and new forms. Change-Id: Ib5ae74e927cfa81312baf7b04ff4104b0b4f936e Reviewed-on: https://code.wireshark.org/review/830 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-23Add Lua Struct.values() function, and prevent coercion in all Struct functionsHadriel Kaplan1-0/+19
This adds a Struct.values() function to get the number of values needed/returned with Struct.pack/unpack. It also changes the existing Struct functions such that they don't coerce a non-string argument into a string. (not preventing it confused a user on ask.wireshark.org) Change-Id: I93d5846105e55b67680e1c276a7286535c77b039 Reviewed-on: https://code.wireshark.org/review/790 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-22Fix spelling mistakes in Lua test scriptsHadriel Kaplan4-28/+28
Change-Id: I8671eb3d3b46ec5c723a6545451ecbb33a10c807 Reviewed-on: https://code.wireshark.org/review/788 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-22Add way for Lua file reader to save state per file read/write opsHadriel Kaplan3-261/+528
Lua can create a file reader/writer, to open new capture file formats or write to new ones. To save local state, it can save things in Lua itself; but since there can be multiple open files at the same time (for example during a reload), the Lua script won't know for which file and state its read/write functions are being invoked for. To remedy this, and also provide a convenient way to store such state, this commit adds the ability for a Lua script to store a Lua table in the wtap/wtap_dumper's priv data member, just like C-code-based reader/writers do. Change-Id: Ifc9e0d5f0379accee56f2a04b6080238670fec52 Reviewed-on: https://code.wireshark.org/review/766 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-19Fix lua file testsuite not working and weak heuristic readers not being ↵Hadriel Kaplan4-11/+31
registered The testsuite for Lua file reader/writer uses the acme_file.lua script to generate a pcapng file from an Acme sipmsg.log file. It then compares the tshark verbose output of this new pcapng file to a sip.pcapng file in the test/captures directory that was previously made. Unfortunately, the acme_file.lua script generates a timestamp based on local system timezone, rather than UTC, so the testsuite fails if not run in the EST timezone where the sip.pcapng file was originally made. This has now been fixed. Also, trying to register new weak heuristic readers fails because the GArray is terminated with a NULL-based row without Glib knowing about that. So this commit changes it to let Glib handle the NULL-terminated row, so that appending takes it into account automatically. Change-Id: I037ce1cfbda03585b3a1e159df78ff8ebb41fc32 Reviewed-on: https://code.wireshark.org/review/741 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19Add capture file reader/writer support for Lua so scripts can implement new ↵Michael Mann5-0/+2147
capture file formats. This enables a Lua script to implement a brand new capture file format reader/writer, so that for example one could write a script to read from vendor-specific "logs" of packets, and show them as normal packets in wireshark. Change-Id: Id394edfffa94529f39789844c382b7ab6cc2d814 Reviewed-on: https://code.wireshark.org/review/431 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-14Add Lua heuristic dissector supportHadriel Kaplan5-17/+215
This adds the ability for Lua scripts to register heuristic dissectors for any protocol that has registered a heuristic dissector list, such as UDP, TCP, and ~50 others. The Lua function can also establish a conversation tied to its Proto dissector, to avoid having to check the heuristics for the same flow. The example dissector in the testsuite has also been enhanced to include a heuristic dissector, to verify the functionality and provide an example implementation. Change-Id: Ie232602779f43d3418fe8db09c61d5fc0b59597a Reviewed-on: https://code.wireshark.org/review/576 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-13add a test for SSL/TLS decryption using the master secretMartin Kaiser3-3/+22
rename the existing SSL test to clarify that it uses the server's private key for decryption Change-Id: I13598fc4cf724b144a8f27bfa7a3316acfc78728 Reviewed-on: https://code.wireshark.org/review/640 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-11Fix Bug 9870 'Lua: trying to call/get an invalid name results in a get-loop ↵Hadriel Kaplan2-4/+16
error' Due to the change I made previously for how methods are accessed, if you try to access one that doesn't exist (for example mistype it or whatever), you get an internal Lua error about a loop in table get, as opposed to the right error message about the field not existing. That's because I had set the class' metatable __index metamethod to point to the class table, which of course has the metatable with the __index metamethod, causing a lookup loop. Blech. Change-Id: I20d3717feadd45f652c2640e1671846184e7082d Reviewed-on: https://code.wireshark.org/review/593 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-10Add GLib's regex library into LuaHadriel Kaplan8-2/+1465
While Lua's built-in pattern support is ok for simple things, many people end up wanting a real regex engine. Since Wireshark already includes the GLib Regex library (a wrapper for PCRE), it makes sense to expose that library to Lua scripts. This has been done using Lrexlib, one of the most popular regex bindings for Lua. Lrexlib didn't support binding GLib's Regex in particular - it does for PCRE but GLib is a different API - so I've done that. A fairly thorough testsuite came along with that, which has been incorporated into the wireshark wslua testuites as well in this commit. Change-Id: I05811d1edf7af8d7c9f4f081de6850f31c0717c7 Reviewed-on: https://code.wireshark.org/review/332 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-05Add test to dump glossaries.Evan Huus1-1/+20
All it checks is that they don't crash, but this is enough to catch malformed extended value strings and other oddities. Change-Id: If853e8e2b19517a784daa4bbb8e41eddc7c7ddd9 Reviewed-on: https://code.wireshark.org/review/520 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25Fix bug 6357: Lua all_field_infos() broken within tap/listenerHadriel Kaplan1-3/+70
The current API for Lua provides a global function "all_field_infos()" which returns all the populated field_info nodes in the current proto_tree. By default all_field_infos() "works", in the literal sense: it returns exactly the fields the previous dissectors of the packet have populated at that instant of time. But of course dissectors don't populate all the applicable fields most of the time, because of the TRY_TO_FAKE_THIS_ITEM optimization where they don't fill in things that aren't needed at the time by a display, color, or tap's dfilter. So this commit offers a way to force the dissectors to populate all the applicable field_infos in the tree, by setting the proto_tree to be visible. Obviously that is going to impact performance, since it basically bypasses the TRY_TO_FAKE_THIS_ITEM optimization; so the patch only does this if the Lua script author told it to explicitly, by adding an argument to Listener.new() and register_postdissector(). Change-Id: I11d3559fbe8c14fbadf1b51415a3701dc1200b7b Reviewed-on: https://code.wireshark.org/review/286 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25Adds some Lua helper functions: some commonly used functions, and to help ↵Hadriel Kaplan2-19/+23
troubleshooting Lua scripts There are some common things people need to do, such as convert to/from hex or get the raw binary string in a ByteArray/Tvb/TvbRange. These have been added, as well as some tests for them in the testsuites. Also, functions have been added to allow a script to get all the available tap types and filter fields, since they are not exactly what one can see in the Wireshark gui. Change-Id: I92e5e4eae713bb90d79b0c024eaa4e55b99cc96b Reviewed-on: https://code.wireshark.org/review/249 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-24Remove executable bit from a few filesPascal Quantin2-0/+0
Change-Id: Ib9be221e3d325379c8b665ab73d976254bb23bb6 Reviewed-on: https://code.wireshark.org/review/342 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-02-21Fix bug 9790: Lua: wslua allows duplicate field registrationHadriel Kaplan2-0/+594
As discussed in bug 3513 and 9709, one can register more than one new ProtoFields for the same field name. Of course C-code can do that too, and does a LOT apparently, but if they're not similar ftypes then things can get scrweed up in display filters. So this change prevents duplicate field registration of dissimilar ftypes. The similarity is based on the discussion on the mailing list, and the listing in README.developer has been updated to refelect that as well. Also, this change adds a testscript for Proto/ProtoFields. Change-Id: I43bd323f785245941a21289647332a19adec2a9d Reviewed-on: https://code.wireshark.org/review/285 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-21Add test suite for verifying Lua global variables/tables of previous ↵Hadriel Kaplan6-0/+2313
releases have not disappeared. Several bugs have been introduced due to changing of perl scripts or #define names, such that things exported into Lua have dissapeared or changed unintentionally. This commit adds a test suite which compares the Lua global table with the ones from previous releases (1.8 and 1.10), to verify nothing has gone missing. New items can be added, but old ones cannot go away. The added script to verify these things, called 'verify_globals.lua', also has the ability to display what's new - i.e., what was not in the olrder releases. Lastly, this commit also fixes a bug: MENU_STAT_ENDPOINT became MENU_STAT_ENDPOINT_LIST due to a change in the make-init-lua.pl perl script in this 1.11 release. Change-Id: Iba143d1a436e706970635a5f8cc2b317955392bf Reviewed-on: https://code.wireshark.org/review/284 Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2014-02-21Revert "Add test suite for verifying Lua global variables/tables of previous ↵Evan Huus6-2302/+0
releases have not disappeared." This reverts commit 5b7f00178f45149ecdce204f1c71c1598ceedac1. Change-Id: Idf09d25270847970713b67d02bcd7cbc411a4e9c Reviewed-on: https://code.wireshark.org/review/280 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-21Add test suite for verifying Lua global variables/tables of previous ↵Hadriel Kaplan6-0/+2302
releases have not disappeared. Several bugs have been introduced due to changing of perl scripts or #define names, such that things exported into Lua have dissapeared or changed unintentionally. This commit adds a test suite which compares the Lua global table with the ones from previous releases (1.8 and 1.10), to verify nothing has gone missing. New items can be added, but old ones cannot go away. The added script to verify these things, called 'verify_globals.lua', also has the ability to display what's new - i.e., what was not in the olrder releases. Lastly, this commit also fixes a bug: MENU_STAT_ENDPOINT became MENU_STAT_ENDPOINT_LIST due to a change in the make-init-lua.pl perl script in this 1.11 release. Change-Id: Ic46172904256dc535b0fe4543237c07dddb3b9b5 Reviewed-on: https://code.wireshark.org/review/242 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-20Fix mode for lua test suiteEvan Huus1-0/+0
Change-Id: If516472ca9c4a0ae84da22a0ecfc9449f0495cbb Reviewed-on: https://code.wireshark.org/review/273 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-20Add 4 more test scripts for Lua, and its own testsuite menuHadriel Kaplan7-104/+1086
This adds test scripts for verifying Pinfo, Address, Field, FieldInfo, NSTime and Listener classes/functions. It also moves Lua test scripts out of unittests and into its own new testsuite. Change-Id: I65c238fd459efb96db3f8f9145842cd038dea7c7 Reviewed-on: https://code.wireshark.org/review/270 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-14Adds support for Lua struct library so one can pack/unpack binary structuresHadriel Kaplan2-0/+356
This is based on Roberto Ierusalimschy's struct library, along with additional options based on Flemming Madsen's patch to the lua-users mailing list, and some changes I made to support 64-bit integer packing/unpacking. Details are in the top comments for wslua_struct.c. This also includes a test script. Change-Id: Ifcd0116ba013d5c760927721c8d6e9f28965534b Reviewed-on: https://code.wireshark.org/review/98 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>