Description
Hello,
I'm extending can-utils toolset for my personal usage, and wanted to discuss whether these tools may be useful to be added to repo.
I've created tool for finding possible ISO TP traffic on a bus, and interpreting frames as UDS services.
Goal is to create tools for preliminary analysis of network/devices structure. I find them useful for analysis of unknown high-load buses, as isotp* tools right now needs source and desination addresses, which may be unknown at the beginning.
Please have look at these use cases:
Simply interpret candump frames as UDS and display possible match:
$ candump -t z vcan0 | ./udsinterpreter -r
[601] 22 0B 0C 0D 0E 0F AA AA
[601] [SRQ] ReadDataByIdentifier DID: 0x0B0C
[600] 22 3E 39 38 3B 3A 55 55
[600] [SRQ] ReadDataByIdentifier DID: 0x3E39
[600] 21 31 30 33 32 3D 3C 3F
[600] [SRQ] Unknown service
Interpret each frame from candump as separate one - find ISO TP type and (for Single and First frames) perform UDS analysis
$ candump -t z vcan0 | ./udsinterpreter -r -i -u
[600] 02 27 05 55 55 55 55 55 ISO TP Type: Single Len: 2 | [SRQ] SecurityAccess Sub: Unknown (0x05)
[600] 30 00 0A 55 55 55 55 55 ISO TP Type: FlowCt IDX: 0
[601] 21 04 05 06 07 08 09 0A ISO TP Type: Consec IDX: 1
[601] 22 0B 0C 0D 0E 0F AA AA ISO TP Type: Consec IDX: 2
[600] 10 12 27 06 35 34 37 36 ISO TP Type: First Len: 18 | [SRQ] SecurityAccess Sub: Unknown (0x06)
[600] 22 3E 39 38 3B 3A 55 55 ISO TP Type: Consec IDX: 2
[600] 21 31 30 33 32 3D 3C 3F ISO TP Type: Consec IDX: 1
[601] 30 00 01 AA AA AA AA AA ISO TP Type: FlowCt IDX: 0
[601] 02 67 06 AA AA AA AA AA ISO TP Type: Single Len: 2 | [PSR] SecurityAccess Sub: Unknown (0x06)
[600] 04 31 01 05 73 55 55 55 ISO TP Type: Single Len: 4 | [SRQ] RoutineControl Start routine (0x01) ID: 0x0573 data:55 55 55
[601] 04 71 01 05 73 AA AA AA ISO TP Type: Single Len: 4 | [PSR] RoutineControl Start routine (0x01) ID: 0x0573 data:AA AA AA
[601] 10 12 67 05 00 01 02 03 ISO TP Type: First Len: 18 | [PSR] SecurityAccess Sub: Unknown (0x05)
Interpret each frame from isotpsniffer (or isotprecv) as UDS message, display possible match (sorry for 'unknown service' here, I don't have good traffic at the moment here, it will display found service in a same way as in the use cases above)
$ ./isotpsniffer -s 1da -d 482 -q -t z -f 1 vcan0 | ./udsinterpreter -r
[482] 00 1E 32 02 08 02 3A 12 12 10 E2 9A 94 2C A8 DB B4 B3 33 36 E3 D2 A6 C7 19 8A 52 04 0A 02 08 05
[482] [???] Unknown service
[482] 00 20 32 02 08 02 3A 12 12 10 E2 9A 94 2C A8 DB B4 B3 33 36 E3 D2 A6 C7 19 8A 52 06 0A 04 08 06 20 02
[482] [???] Unknown service
Do you find that useful?
Any comments about formatting? What do you think about using the tool with pipe, not as standalone?