Skip to content

Commit edbcf15

Browse files
authored
Support of personal lua plugin directory (#9)
* support personal lua plugin path, v1.3.1 * cleanup * updated linux hints * (re-)added port 15118 for v2gtp * updated README
1 parent 31d542b commit edbcf15

12 files changed

Lines changed: 454 additions & 411 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ jobs:
3333
cp ./V2G_Libraries/V2GDecoder/bin/* ./artifact_dir/
3434
mkdir artifact_dir/plugins
3535
cp ./Wireshark/plugins/* ./artifact_dir/plugins/
36-
echo "dSPACE V2Gshark Wireshark Plugin" > ./artifact_dir/README
37-
echo "Please copy these files to your Wireshark installation." >> ./artifact_dir/README
36+
cp ./LICENSE ./artifact_dir/dsV2Gshark_LICENSE.txt
37+
cp ./README.md ./artifact_dir/dsV2Gshark_README.txt
3838
3939
- name: Upload Win64 Files
4040
uses: actions/upload-artifact@v4
4141
with:
42-
name: dsV2Gshark_Files_Win_x64
42+
name: dsV2Gshark_Files_Win_x86_64
4343
path: artifact_dir/*
4444

4545
build-linux:
@@ -60,8 +60,8 @@ jobs:
6060
cp ./V2G_Libraries/V2GDecoder/bin/* ./artifact_dir/
6161
mkdir artifact_dir/plugins
6262
cp ./Wireshark/plugins/* ./artifact_dir/plugins/
63-
echo "dSPACE V2Gshark Wireshark Plugin" > ./artifact_dir/README
64-
echo "Please copy these files to your Wireshark installation." >> ./artifact_dir/README
63+
cp ./LICENSE ./artifact_dir/dsV2Gshark_LICENSE.txt
64+
cp ./README.md ./artifact_dir/dsV2Gshark_README.txt
6565
6666
- name: Upload Linux Files
6767
uses: actions/upload-artifact@v4

Installer/InstallerScript.iss

Lines changed: 358 additions & 357 deletions
Large diffs are not rendered by default.

OSSAcknowledgements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ cbExiGen
141141

142142
The license text of the 'Apache License Version 2.0' can be found in APPENDIX A.
143143

144-
Wireshark 4.2.4
144+
Wireshark 4.2.5
145145
Copyright:
146146
Copyright 1998-2024 Gerald Combs <gerald@wireshark.org> and contributors
147147
Repository: https://gitlab.com/wireshark/wireshark
148148
License: GNU GENERAL PUBLIC LICENSE v2.0
149149

150150
The license text of the 'GNU GENERAL PUBLIC LICENSE v2.0' can be found in APPENDIX A.
151151

152-
GnuTLS 3.8.3
152+
GnuTLS 3.8.4
153153
URL: https://www.gnutls.org/
154154
License: GnuTLS License
155155

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Click on a packet in the graph to inspect it in the Wireshark main window. Press
4848

4949
## Installation notes
5050
- The installer can be downloaded from [GitHub Releases](https://github.com/dspace-group/dsV2Gshark/releases/latest)
51+
- To use the plugin without installer, download the zipped files from [GitHub Releases](https://github.com/dspace-group/dsV2Gshark/releases/latest) and copy its content manually into your Wireshark installation or into your personal plugin directory (Windows: %appdata%/wireshark/, Linux: ~/.local/lib/wireshark/). The filter buttons, color filter and I/O Graph configuration must be added manually in this case.
5152
- When updating Wireshark, please reinstall the plugin to avoid any warnings
5253
- Not compatible with other V2G dissector plugins. Please uninstall these plugins before installing dsV2Gshark.
5354
- Not compatible with 32 bit versions of Wireshark.
@@ -60,8 +61,8 @@ Click on a packet in the graph to inspect it in the Wireshark main window. Press
6061
- ISO 15118-20 is not fully supported yet
6162
- please let us know if you encounter incorrectly decoded packets
6263
- Linux
63-
- no installer
64-
- filter buttons and color filters must be added manually
64+
- No installer, see [Installation Notes](#installation-notes). Make sure you have read permissions for all files.
65+
- Filter buttons and color filters must be added manually
6566
- I/O graph must be configured manually
6667

6768
## Support
@@ -71,7 +72,7 @@ Click on a packet in the graph to inspect it in the Wireshark main window. Press
7172
## Further notes
7273
- When sniffing V2G communication, lost packets may occur, which cause corrupted TCP/TLS sessions. In that case, it may help to activate the option to ignore Message Authentication Code (MAC) check failures in the Wireshark TLS protocol settings.
7374
This option can be found under Wireshark Preferences - Protocols - TLS
74-
- This plugin was built and tested with Wireshark 4.2.4
75+
- This plugin was built and tested with Wireshark 4.2.5
7576
- The EXI decoding is based on [cbExiGen](https://github.com/EVerest/cbexigen)
7677

7778

V2G_Libraries/CertificateInfos/main.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <windows.h>
22

3-
#define VER_FILEVERSION 1,3,0,0
4-
#define VER_FILEVERSION_STR "1.3.0.0\0"
3+
#define VER_FILEVERSION 1,3,1,0
4+
#define VER_FILEVERSION_STR "1.3.1.0\0"
55
#define VER_COMPANYNAME_STR "dSPACE GmbH"
66
#define VER_PRODUCTNAME_STR "V2gCertificateInfos"
7-
#define VER_PRODUCTVERSION 1,3,0,0
8-
#define VER_PRODUCTVERSION_STR "1.3.0.0\0"
7+
#define VER_PRODUCTVERSION 1,3,1,0
8+
#define VER_PRODUCTVERSION_STR "1.3.1.0\0"
99

1010
VS_VERSION_INFO VERSIONINFO
1111
FILEVERSION VER_FILEVERSION

V2G_Libraries/V2GDecoder/main.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <windows.h>
22

3-
#define VER_FILEVERSION 1,3,0,0
4-
#define VER_FILEVERSION_STR "1.3.0.0\0"
3+
#define VER_FILEVERSION 1,3,1,0
4+
#define VER_FILEVERSION_STR "1.3.1.0\0"
55
#define VER_COMPANYNAME_STR "dSPACE GmbH"
66
#define VER_PRODUCTNAME_STR "V2gDecoder"
7-
#define VER_PRODUCTVERSION 1,3,0,0
8-
#define VER_PRODUCTVERSION_STR "1.3.0.0\0"
7+
#define VER_PRODUCTVERSION 1,3,1,0
8+
#define VER_PRODUCTVERSION_STR "1.3.1.0\0"
99

1010
VS_VERSION_INFO VERSIONINFO
1111
FILEVERSION VER_FILEVERSION

Wireshark/plugins/v2gmsg.lua

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,34 @@
1010
--
1111
-- See license file (dsV2Gshark_LICENSE.txt)
1212
--
13-
DS_V2GSHARK_VERSION = "1.3.0" -- DO NOT CHANGE
13+
14+
-- do OS specific stuff, required to properly load v2g libs
15+
local plugins_path -- path to the plugins directory of this script
16+
local lib_pattern
17+
if package.config:sub(1, 1) == "\\" then
18+
-- WINDOWS
19+
plugins_path = debug.getinfo(1, "S").source:sub(2):match("(.*[/\\])") or "./"
20+
lib_pattern = "?.dll"
21+
else
22+
-- UNIX
23+
plugins_path = debug.getinfo(1, "S").source:sub(2):match("(.*/)") or "./"
24+
lib_pattern = "?.so"
25+
end
26+
local wireshark_path = plugins_path .. "../"
27+
if not string.find(plugins_path, package.path) then
28+
-- extend path (where to load .lua files)
29+
package.path = package.path .. ";" .. plugins_path .. "?.lua"
30+
end
31+
if not string.find(wireshark_path, package.cpath) then
32+
-- extend cpath (where to load .so files)
33+
package.cpath = package.cpath .. ";" .. wireshark_path .. lib_pattern .. ";" .. plugins_path .. lib_pattern
34+
end
35+
36+
local v2gshared = require("v2gshared")
1437

1538
p_v2gmsg = Proto("v2gmsg", "V2G Message")
1639
local p_v2gmsg_info = {
17-
version = DS_V2GSHARK_VERSION,
40+
version = v2gshared.DS_V2GSHARK_VERSION,
1841
author = "dSPACE GmbH",
1942
description = "Dissector for V2G Messages (DIN 70121, ISO15118-2, ISO15118-20)"
2043
}
@@ -25,27 +48,6 @@ local v2g_decoder = require("v2gLuaDecoder")
2548
v2g_decoder.initValidator()
2649
local cert_info_extractor = require("v2gX509CertInfos")
2750

28-
-- Settings
29-
p_v2gmsg.prefs["infotext"] = Pref.statictext("dSPACE V2Gshark Wireshark Plugin")
30-
p_v2gmsg.prefs["additionalinfo"] = Pref.statictext("powered by chargebyte cbExiGen")
31-
p_v2gmsg.prefs["additionalinfo2"] = Pref.statictext("")
32-
p_v2gmsg.prefs["portrange_tlssecret"] =
33-
Pref.range(
34-
"TLS secret UDP port(s)",
35-
"49152-65535",
36-
"UDP source ports of TLS secret disclosure packets.\n\nDefault: '49152-65535'",
37-
65535
38-
)
39-
p_v2gmsg.prefs["portrange_v2g"] =
40-
Pref.range(
41-
"V2G message TCP port(s)",
42-
"49152-65535",
43-
"TCP source ports of V2G request and response messages.\n\nDefault: '49152-65535'",
44-
65535
45-
)
46-
p_v2gmsg.prefs["additionalinfo3"] = Pref.statictext("")
47-
p_v2gmsg.prefs["versioninfo"] = Pref.statictext("Version " .. DS_V2GSHARK_VERSION)
48-
4951
-- Buffer for all decoded messages. Maps packetID -> xml string (or nil)
5052
local xml_buffer = {}
5153

@@ -128,10 +130,6 @@ function p_v2gmsg.init()
128130
decoded_with_auto_schema_detection = {}
129131
decoded_with_schema_namespace = {}
130132
decoded_error_code = {}
131-
132-
-- register v2g ports
133-
DissectorTable.get("tls.port"):add(p_v2gmsg.prefs["portrange_v2g"], p_v2gtp)
134-
DissectorTable.get("tcp.port"):add(p_v2gmsg.prefs["portrange_v2g"], p_v2gtp)
135133
end
136134

137135
local function decode_v2g_message(schema, exi_string, packet_number)

Wireshark/plugins/v2gsdp.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
--
55
-- See license file (dsV2Gshark_LICENSE.txt)
66
--
7+
local v2gshared = require("v2gshared")
78

89
p_sdpreq = Proto("v2gsdp-req", "V2G SECC Discovery Protocol Request")
910
p_sdpres = Proto("v2gsdp-res", "V2G SECC Discovery Protocol Response")
1011
local p_v2gsdp_info = {
11-
version = DS_V2GSHARK_VERSION,
12+
version = v2gshared.DS_V2GSHARK_VERSION,
1213
author = "dSPACE GmbH"
1314
}
1415
set_plugin_info(p_v2gsdp_info)

Wireshark/plugins/v2gshared.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--
2+
-- Copyright 2024, dSPACE GmbH. All rights reserved.
3+
--
4+
-- See license file (dsV2Gshark_LICENSE.txt)
5+
--
6+
local v2gshared = {}
7+
8+
v2gshared.DS_V2GSHARK_VERSION = "1.3.1" -- DO NOT CHANGE
9+
10+
return v2gshared

Wireshark/plugins/v2gtlssecret.lua

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,29 @@
55
--
66
-- See license file (dsV2Gshark_LICENSE.txt)
77
--
8+
local v2gshared = require("v2gshared")
89

910
p_v2gtlssecret = Proto("v2gtlssecret", "V2G TLS secret")
1011
local p_v2gtlssecret_info = {
11-
version = DS_V2GSHARK_VERSION,
12+
version = v2gshared.DS_V2GSHARK_VERSION,
1213
author = "dSPACE GmbH"
1314
}
1415
set_plugin_info(p_v2gtlssecret_info)
1516

17+
-- Settings
18+
p_v2gtlssecret.prefs["infotext"] = Pref.statictext("dSPACE V2Gshark Wireshark Plugin")
19+
p_v2gtlssecret.prefs["additionalinfo"] = Pref.statictext("powered by chargebyte cbExiGen")
20+
p_v2gtlssecret.prefs["additionalinfo2"] = Pref.statictext("")
21+
p_v2gtlssecret.prefs["portrange_tlssecret"] =
22+
Pref.range(
23+
"TLS secret UDP port(s)",
24+
"49152-65535",
25+
"UDP source ports of TLS secret disclosure packets.\n\nDefault: '49152-65535'",
26+
65535
27+
)
28+
p_v2gtlssecret.prefs["additionalinfo3"] = Pref.statictext("")
29+
p_v2gtlssecret.prefs["versioninfo"] = Pref.statictext("Version " .. v2gshared.DS_V2GSHARK_VERSION)
30+
1631
local min_wireshark_version = "3.5.0"
1732

1833
local f_cr = ProtoField.string("v2gtlssecret.clientrandom", "NSS Key Log", base.ASCII)
@@ -204,6 +219,6 @@ end -- end function 'p_v2gtlssecret.dissector'
204219
-- initialization routine
205220
function p_v2gtlssecret.init()
206221
-- register tls secret ports
207-
DissectorTable.get("udp.port"):add(p_v2gmsg.prefs["portrange_tlssecret"], p_v2gtlssecret)
222+
DissectorTable.get("udp.port"):add(p_v2gtlssecret.prefs["portrange_tlssecret"], p_v2gtlssecret)
208223
frame_numbers = {}
209224
end

0 commit comments

Comments
 (0)