Skip to content

Commit 02b8697

Browse files
authored
v1.4.1, Fix for homeplug-av packets (SLAC) on old wireshark versions
* use heuristic dissector on ethernet level * formatted * update version to 1.4.1
1 parent 53be2a9 commit 02b8697

5 files changed

Lines changed: 44 additions & 29 deletions

File tree

Installer/InstallerScript.iss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT CHANGE VERSION HERE! Run update_version.bat
2-
#define AppVer "1.4.0"
2+
#define AppVer "1.4.1"
33
#define AppId "dsV2Gshark"
44

55
[Setup]
@@ -260,9 +260,12 @@ begin
260260
'"TRUE","[V2G ext]","v2gtp or v2gtlssecret or tls.handshake or tls.alert_message or tcp.flags.syn == 1 or tcp.flags.fin == 1 or homeplug or homeplug-av ",""',
261261
'"TRUE","[V2G]","v2gtp or v2gtlssecret",""',
262262
263-
// current buttons
263+
// v1.4.0 buttons
264264
'"TRUE","[V2G ext]","v2gtp or v2gtlssecret or tls.handshake or tls.alert_message or tls.change_cipher_spec or tcp.flags.syn == 1 or tcp.flags.fin == 1 or homeplug or homeplug-av ","Filter V2G messages, SLAC messages and additional TCP packets"',
265-
'"TRUE","[V2G]","v2gtp or v2gtlssecret","Filter V2G messages"'];
265+
266+
// current buttons
267+
'"TRUE","[V2G]","v2gtp or v2gtlssecret","Filter V2G messages"',
268+
'"TRUE","[V2G ext]","v2gtp or v2gtlssecret or tls.handshake or tls.alert_message or tls.change_cipher_spec or tcp.flags.syn == 1 or tcp.flags.fin == 1 or homeplug or homeplug-av or homeplug-llc ","Filter V2G messages, SLAC messages and additional TCP packets"'];
266269
RemoveFromFile(FileName, LinesToRemove);
267270
268271
FileName := GetWiresharkConfigPath + 'io_graphs'
@@ -283,7 +286,7 @@ begin
283286
if WizardIsComponentSelected('buttons') then
284287
begin
285288
FileName := GetWiresharkConfigPath + 'dfilter_buttons'
286-
StringsToCheck := ['"TRUE","[V2G ext]","v2gtp or v2gtlssecret or tls.handshake or tls.alert_message or tls.change_cipher_spec or tcp.flags.syn == 1 or tcp.flags.fin == 1 or homeplug or homeplug-av ","Filter V2G messages, SLAC messages and additional TCP packets"',
289+
StringsToCheck := ['"TRUE","[V2G ext]","v2gtp or v2gtlssecret or tls.handshake or tls.alert_message or tls.change_cipher_spec or tcp.flags.syn == 1 or tcp.flags.fin == 1 or homeplug or homeplug-av or homeplug-llc ","Filter V2G messages, SLAC messages and additional TCP packets"',
287290
'"TRUE","[V2G]","v2gtp or v2gtlssecret","Filter V2G messages"']
288291
StringsToAdd := CheckLines(FileName, StringsToCheck)
289292
if Length(StringsToAdd) > 0 then

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,4,0,0
4-
#define VER_FILEVERSION_STR "1.4.0.0\0"
3+
#define VER_FILEVERSION 1,4,1,0
4+
#define VER_FILEVERSION_STR "1.4.1.0\0"
55
#define VER_COMPANYNAME_STR "dSPACE GmbH"
66
#define VER_PRODUCTNAME_STR "V2gCertificateInfos"
7-
#define VER_PRODUCTVERSION 1,4,0,0
8-
#define VER_PRODUCTVERSION_STR "1.4.0.0\0"
7+
#define VER_PRODUCTVERSION 1,4,1,0
8+
#define VER_PRODUCTVERSION_STR "1.4.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,4,0,0
4-
#define VER_FILEVERSION_STR "1.4.0.0\0"
3+
#define VER_FILEVERSION 1,4,1,0
4+
#define VER_FILEVERSION_STR "1.4.1.0\0"
55
#define VER_COMPANYNAME_STR "dSPACE GmbH"
66
#define VER_PRODUCTNAME_STR "V2gDecoder"
7-
#define VER_PRODUCTVERSION 1,4,0,0
8-
#define VER_PRODUCTVERSION_STR "1.4.0.0\0"
7+
#define VER_PRODUCTVERSION 1,4,1,0
8+
#define VER_PRODUCTVERSION_STR "1.4.1.0\0"
99

1010
VS_VERSION_INFO VERSIONINFO
1111
FILEVERSION VER_FILEVERSION

Wireshark/plugins/v2gcommon.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ end
2828

2929
local v2gcommon = {}
3030

31-
v2gcommon.DS_V2GSHARK_VERSION = "1.4.0" -- DO NOT CHANGE
31+
v2gcommon.DS_V2GSHARK_VERSION = "1.4.1" -- DO NOT CHANGE
3232

3333
return v2gcommon

Wireshark/plugins/v2gllc.lua

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
--
77
-- See license file (dsV2Gshark_LICENSE.txt)
88
--
9+
local HPAV_PACKET_SIZE = 60
10+
local HPAV_ETHERNET_TYPE = 0x88e1
11+
912
local v2gcommon = require("v2gcommon")
1013

11-
p_hpav_llc = Proto("homeplug-av-llc", "HomePlug AV protocol LLC diagnostics")
14+
p_hpav_llc = Proto("homeplug-llc", "HomePlug AV protocol LLC diagnostics")
1215
local p_hpav_llc_info = {
1316
version = v2gcommon.DS_V2GSHARK_VERSION,
1417
author = "dSPACE GmbH",
@@ -115,22 +118,20 @@ local function cp_state_to_int(cp_state)
115118
return 0
116119
end
117120

118-
function p_hpav_llc.dissector(buf, pinfo, root)
119-
if buf:len() == 0 then
121+
local heuristic_hpav_dissector = function(buf, pinfo, root)
122+
-- check size
123+
if buf:len() ~= HPAV_PACKET_SIZE then
120124
return 0
121125
end
122126

123-
-- always call default homeplug-av dissector first
124-
local hpav_dissector = Dissector.get("homeplug-av")
125-
local consumed_bytes_hpav
126-
if hpav_dissector ~= nil then
127-
consumed_bytes_hpav = hpav_dissector:call(buf, pinfo, root)
128-
else
129-
-- some older wireshark versions does not have a homeplug-av dissector
130-
consumed_bytes_hpav = Dissector.get("data"):call(buf, pinfo, root)
131-
pinfo.cols.info = "Homeplug AV"
127+
-- check eth type
128+
if buf(12, 2):uint() ~= HPAV_ETHERNET_TYPE then
129+
return 0
132130
end
133131

132+
buf = buf(14):tvb() -- skip eth header
133+
134+
-- check hpav message type
134135
local mac_mme_type = buf(1, 2):le_uint()
135136
local mme_vendor = buf(5, 3):uint()
136137
local freq, dutycycle, voltage, result
@@ -139,8 +140,18 @@ function p_hpav_llc.dissector(buf, pinfo, root)
139140
elseif mme_vendor == 0x0080E1 and mac_mme_type == 0xA22E then -- Vendor OUI: ST/IoTecha
140141
freq, dutycycle, voltage, result = extract_infos_iotecha(buf)
141142
else
142-
-- default homeplug-av packet
143-
return consumed_bytes_hpav
143+
return 0
144+
end
145+
146+
root:add(
147+
"Ethernet II,",
148+
"dissection skipped for this packet! If you want to inspect this layer, please deactivate homeplug-llc"
149+
)
150+
151+
-- call default hpav dissector to add additional information
152+
local hpav_dissector = Dissector.get("homeplug-av")
153+
if hpav_dissector ~= nil then
154+
hpav_dissector:call(buf, pinfo, root)
144155
end
145156

146157
pinfo.cols.protocol = "HomePlug AV LLC"
@@ -177,7 +188,8 @@ function p_hpav_llc.dissector(buf, pinfo, root)
177188
else
178189
pinfo.cols.info = "CP State: " .. cp_state
179190
end
180-
return buf:len()
191+
return HPAV_PACKET_SIZE
181192
end
182193

183-
DissectorTable.get("ethertype"):add(0x88e1, p_hpav_llc)
194+
-- use heuristic dissection on ethernet layer to support older wireshark versions
195+
p_hpav_llc:register_heuristic("eth", heuristic_hpav_dissector)

0 commit comments

Comments
 (0)