Skip to content

Commit

Permalink
Merge pull request #1 from dspace-group/feature/ioGraph
Browse files Browse the repository at this point in the history
Added I/O Graph support
  • Loading branch information
TGruett authored Apr 3, 2024
2 parents a88de19 + 76cd7e1 commit d9385a6
Show file tree
Hide file tree
Showing 7 changed files with 527 additions and 446 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
settings.json
Binary file added Images/IO_Graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 45 additions & 1 deletion Installer/InstallerScript.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DO NOT CHANGE VERSION HERE! Run update_version.bat
#define AppVer "1.1.0"
#define AppVer "1.2.0"
#define AppId "dsV2Gshark"

[Setup]
Expand Down Expand Up @@ -33,6 +33,9 @@ Name: "dsV2Gshark_strings"; MessagesFile: "strings.isl"
Name: "full"; Description: "Full installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[CustomMessages]
Linebreak=%n

[Components]
Name: "plugin"; Description: "Plugin files"; Types: full custom; Flags: fixed
Name: "plugin/dissectors"; Description: "V2G dissectors"; Types: full custom; Flags: fixed
Expand All @@ -44,6 +47,7 @@ Name: "plugin/autoschema"; Description: "Automatic schema detection"; Types: ful
Name: "plugin/autodecrypt"; Description: "Live TLS decryption with disclosed master secret from UDP packet"; Types: full custom;
Name: "buttons"; Description: "Add filter buttons to Wireshark (current user only)"; Types: full
Name: "colorfilters"; Description: "Highlight V2G messages in Wireshark (current user only)"; Types: full
Name: "iograph"; Description: "Prepare Wireshark I/O Graphs for V2G messages{cm:Linebreak}(current user only, may override I/O Graph preferences)"; Types: full

[Files]
Source: "..\Wireshark\plugins\v2gmsg.lua"; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs; Components: plugin/dissectors
Expand Down Expand Up @@ -256,6 +260,10 @@ begin
'"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"',
'"TRUE","[V2G]","v2gtp or v2gtlssecret","Filter V2G messages"'];
RemoveFromFile(FileName, LinesToRemove);
FileName := GetWiresharkConfigPath + 'io_graphs'
LinesToRemove := ['v2gtp', 'v2gmsg', 'CP State']
RemoveFromFile(FileName, LinesToRemove);
end;
procedure CurStepChanged(CurStep: TSetupStep);
Expand Down Expand Up @@ -304,6 +312,42 @@ begin
if not PrependStringsToFile(FileName, StringsToAdd) then
MsgBox('Failed to add colorfilters to Wireshark!', mbError, MB_OK);
end;
if WizardIsComponentSelected('iograph') then
begin
// add graph io presets after installation
FileName := GetWiresharkConfigPath + 'io_graphs'
StringsToAdd := [ '"Enabled","#V2G-Packets/Interval","v2gtp","#D3D3D3","Square","Packets","v2gtp","None","1"',
'"Enabled","Target Voltage EV","","#AA0000","Cross","AVG(Y Field)","v2gmsg.xml.iograph.EVTargetVoltage","None","1"',
'"Enabled","Present Voltage EVSE","","#AA0000","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVSEPresentVoltage","None","1"',
'"Enabled","[ISO20] Present Voltage EV","","#AA6262","Circle","AVG(Y Field)","v2gmsg.xml.iograph.EVPresentVoltage","None","1"',
'"Enabled","Target Current EV","","#0000FF","Cross","AVG(Y Field)","v2gmsg.xml.iograph.EVTargetCurrent","None","1"',
'"Enabled","Present Current EVSE","","#0000FF","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVSEPresentCurrent","None","1"',
'"Enabled","[ISO20] Present SOC","","#AAFF00","Line","AVG(Y Field)","v2gmsg.xml.iograph.PresentSOC","None","1"',
'"Enabled","[DIN/ISO2] Present SOC","","#AAFF00","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVRESSSOC","None","1"',
'"Disabled","[DIN/ISO2] Max Voltage EV","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVMaximumVoltageLimit","None","1"',
'"Disabled","[DIN/ISO2] Max Voltage EVSE","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVSEMaximumVoltageLimit","None","1"',
'"Disabled","[DIN/ISO2] Max Current EV","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVMaximumCurrentLimit","None","1"',
'"Disabled","[DIN/ISO2] Max Current EVSE","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVSEMaximumCurrentLimit","None","1"',
'"Disabled","[ISO20] Max Voltage EV","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVMaximumVoltage","None","1"',
'"Disabled","[ISO20] Min Voltage EV","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVMinimumVoltage","None","1"',
'"Disabled","[ISO20] Max Current EV","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVMaximumChargeCurrent","None","1"',
'"Disabled","[ISO20] Max Voltage EVSE","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVSEMaximumVoltage","None","1"',
'"Disabled","[ISO20] Max Current EVSE","","#2E3436","Line","AVG(Y Field)","v2gmsg.xml.iograph.EVSEMaximumChargeCurrent","None","1"',
'"Disabled","CP State","","#2E3436","Dot","AVG(Y Field)","homeplug_av.st_iotecha.cpstate.state","None","20"'];
if FileExists(FileName) then
begin
if not PrependStringsToFile(FileName, StringsToAdd) then
MsgBox('Failed to add I/O Graph presets to Wireshark!', mbError, MB_OK);
end
else
begin
if not SaveStringsToFile(FileName, StringsToAdd, True) then
begin
MsgBox('Failed to add I/O Graph presets to Wireshark!', mbError, MB_OK);
end;
end;
end;
end;
end;
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This Wireshark plugin allows to analyze and decode packets between electric vehi
![ISO 15118-2 Overview](Images/WS_ISO15118_2_Overview.png)

## Features

### Overview
- Supports decoding of:
- V2GTP layer (Vehicle to Grid Transport Protocol)
- SAP messages (Supported App Protocol)
Expand All @@ -18,11 +20,22 @@ This Wireshark plugin allows to analyze and decode packets between electric vehi
- Additional analysis features:
- Validation of V2G messages according to XSD specification
- Certificate information details for Plug & Charge (PnC)
- Live TLS decryption (see [below](#live-tls-decryption))
- Live TLS decryption
- Automatic schema detection
- Detect schema automatically in case of missing SDP or SAP
- Color filter for V2G packets
- Filter buttons for V2G packets
- Wireshark I/O Graph support for V2G packets

### Live TLS Decryption
The plugin processes a TLS master secret disclosure packet after handshake to decode the following V2G session.
The disclosure message is a UDP packet within the source port range 49152-65535 (see Wireshark protocol settings) containing the ASCII string "CLIENT_RANDOM <32-byte client random> <48-byte master secret>" as payload data. This disclosure message has to be sent from one of the communication partners in a testing environment.

### Wireshark I/O Graph
This optional feature updates the Wireshark I/O Graph preferences to display a V2G session. The graph can be accessed via 'Statistics' -> 'I/O Graphs' (shortcut: Alt + S + I).
The graph displays the data in 1 second intervals. This can be changed using the drop down menu at the bottom.
To simplify the visualisation, some V2G related signals (e.g., MaxVoltage) are disabled by default. They can be enabled using the check boxes in the selection view.
Click on a packet in the graph to inspect it in the Wireshark main window. Press the SPACE key to activate a helper line on the graph if you need more precision.

## Requirements
- Wireshark (64 bit) 3.5.0 or higher
Expand All @@ -41,10 +54,6 @@ This Wireshark plugin allows to analyze and decode packets between electric vehi
- Supports normal and portable version of Wireshark
- Filter buttons and color filters will be installed for the current user only. In multi-user environments, the plugin must be installed for each user to enable these two optional features.

## Live TLS Decryption
The plugin processes a TLS master secret disclosure packet after handshake to decode the following V2G session.
The disclosure message is a UDP packet within the source port range 49152-65535 (see Wireshark protocol settings) containing the ASCII string "CLIENT_RANDOM <32-byte client random> <48-byte master secret>" as payload data. This disclosure message has to be sent from one of the communication partners in a testing environment.

## Limitations
- ISO 15118-20 is not fully supported yet
- some BPT messages are not fully decoded
Expand Down Expand Up @@ -77,3 +86,5 @@ The disclosure message is a UDP packet within the source port range 49152-65535
![Filter Buttons](Images/WS_FilterButtons.png)
### Plugin Preferences
![Plugin Preferences](Images/WS_Preferences.png)
### Wireshark I/O Graph
![I/O Graph](Images/IO_Graph.png)
8 changes: 4 additions & 4 deletions V2G_Libraries/CertificateInfos/main.rc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <windows.h>

#define VER_FILEVERSION 1,1,0,0
#define VER_FILEVERSION_STR "1.1.0.0\0"
#define VER_FILEVERSION 1,2,0,0
#define VER_FILEVERSION_STR "1.2.0.0\0"
#define VER_COMPANYNAME_STR "dSPACE GmbH"
#define VER_PRODUCTNAME_STR "V2gCertificateInfos"
#define VER_PRODUCTVERSION 1,1,0,0
#define VER_PRODUCTVERSION_STR "1.1.0.0\0"
#define VER_PRODUCTVERSION 1,2,0,0
#define VER_PRODUCTVERSION_STR "1.2.0.0\0"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
Expand Down
8 changes: 4 additions & 4 deletions V2G_Libraries/V2GDecoder/main.rc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <windows.h>

#define VER_FILEVERSION 1,1,0,0
#define VER_FILEVERSION_STR "1.1.0.0\0"
#define VER_FILEVERSION 1,2,0,0
#define VER_FILEVERSION_STR "1.2.0.0\0"
#define VER_COMPANYNAME_STR "dSPACE GmbH"
#define VER_PRODUCTNAME_STR "V2gDecoder"
#define VER_PRODUCTVERSION 1,1,0,0
#define VER_PRODUCTVERSION_STR "1.1.0.0\0"
#define VER_PRODUCTVERSION 1,2,0,0
#define VER_PRODUCTVERSION_STR "1.2.0.0\0"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
Expand Down
Loading

0 comments on commit d9385a6

Please sign in to comment.