diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-03-10 01:54:51 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-03-14 07:29:15 +0000 |
commit | 04c39bb0972bac1f95eb9394b5ca1086f19c0d93 (patch) | |
tree | 62171e4584b86bb746d6a73181eb7627a15b9e44 /test/suite-wslua.sh | |
parent | a59ac1bd10d29d05ca5cd657b7c64ab13a08670d (diff) | |
download | wireshark-04c39bb0972bac1f95eb9394b5ca1086f19c0d93.tar.gz wireshark-04c39bb0972bac1f95eb9394b5ca1086f19c0d93.tar.bz2 wireshark-04c39bb0972bac1f95eb9394b5ca1086f19c0d93.zip |
Add Lua heuristic dissector support
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>
Diffstat (limited to 'test/suite-wslua.sh')
-rwxr-xr-x | test/suite-wslua.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/suite-wslua.sh b/test/suite-wslua.sh index f734f41aea..fa682b08d3 100755 --- a/test/suite-wslua.sh +++ b/test/suite-wslua.sh @@ -39,7 +39,7 @@ wslua_step_dissector_test() { fi # then run tshark again with the verification script. (it internally reads in testin.txt) - $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/verify_dissector.lua > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/verify_dissector.lua > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then test_step_ok else @@ -121,7 +121,7 @@ wslua_step_proto_test() { return fi - # First run tshark with the dissector script. + # First run tshark with the proto script. $TSHARK -r $CAPTURE_DIR/dns_port.pcap -V -X lua_script:$TESTS_DIR/lua/proto.lua > testin.txt 2>&1 grep -q "All tests passed!" testin.txt if [ $? -ne 0 ]; then @@ -130,7 +130,7 @@ wslua_step_proto_test() { fi # then run tshark again with the verification script. (it internally reads in testin.txt) - $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/verify_dissector.lua > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/verify_dissector.lua > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then test_step_ok else @@ -148,7 +148,7 @@ wslua_step_int64_test() { fi # Tshark catches lua script failures, so we have to parse the output. - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/int64.lua > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/int64.lua > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then test_step_ok else @@ -165,30 +165,30 @@ wslua_step_args_test() { fi # Tshark catches lua script failures, so we have to parse the output. - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:1 > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:1 > testout.txt 2>&1 grep -q "All tests passed!" testout.txt if [ $? -ne 0 ]; then cat testout.txt test_step_failed "lua_args_test test 1 failed" fi - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:3 -X lua_script1:foo -X lua_script1:bar > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:3 -X lua_script1:foo -X lua_script1:bar > testout.txt 2>&1 grep -q "All tests passed!" testout.txt if [ $? -ne 0 ]; then cat testout.txt test_step_failed "lua_args_test test 2 failed" fi - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:3 -X lua_script2:1 -X lua_script1:foo -X lua_script1:bar > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:3 -X lua_script2:1 -X lua_script1:foo -X lua_script1:bar > testout.txt 2>&1 grep -q "All tests passed!" testout.txt if [ $? -ne 0 ]; then cat testout.txt test_step_failed "lua_args_test test 3 failed" fi - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then cat testout.txt test_step_failed "lua_args_test negative test 4 failed" fi - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:3 > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/script_args.lua -X lua_script1:3 > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then cat testout.txt test_step_failed "lua_args_test negative test 5 failed" @@ -241,7 +241,7 @@ wslua_step_struct_test() { fi # Tshark catches lua script failures, so we have to parse the output. - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/struct.lua > testout.txt 2>&1 + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/struct.lua > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then test_step_ok else |