-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
automotive, j1939: scanning for CAs #5164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d833043
e0626fe
90570fe
e59199f
3414c3b
9e2556b
19212ea
8965e37
626eae0
fafddb9
7a0ee7e
cfec25e
60cfb11
0b2d6ef
d3c482a
8347e30
c2063fa
9917b2c
93ffd77
fbcb5a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| # SPDX-License-Identifier: GPL-2.0-only | ||
| # This file is part of Scapy | ||
| # See https://scapy.net/ for more information | ||
| # Copyright (C) National Motor Freight Traffic Association Inc. | ||
| # <ben.l.gardiner@gmail.com> | ||
|
|
||
| # scapy.contrib.description = SAE J1939 (SAE J1939-21) Transport Layer Socket & Diagnostics | ||
| # scapy.contrib.status = loads | ||
|
|
||
| from scapy.consts import LINUX | ||
| from scapy.config import conf | ||
|
|
||
| from scapy.contrib.j1939 import ( | ||
| J1939, | ||
| J1939_CAN, | ||
| J1939SoftSocket, | ||
| NativeJ1939Socket, | ||
| J1939TPImplementation, | ||
| J1939_BROADCAST_ADDR, | ||
| J1939_PGN_TP_CM, | ||
| J1939_PGN_TP_DT, | ||
| J1939_TP_CTRL_RTS, | ||
| J1939_TP_CTRL_CTS, | ||
| J1939_TP_CTRL_ACK, | ||
| J1939_TP_CTRL_BAM, | ||
| J1939_TP_CTRL_ABORT, | ||
| can_id_to_j1939, | ||
| j1939_to_can_id, | ||
| pgn_from_fields, | ||
| dst_from_fields, | ||
| pgn_is_pdu1, | ||
| log_j1939, | ||
| ) | ||
|
|
||
| J1939_GLOBAL_ADDRESS = J1939_BROADCAST_ADDR | ||
| J1939_NULL_ADDRESS = 0xFE | ||
| PGN_ADDRESS_CLAIMED = 0xEE00 | ||
| PGN_REQUEST = 0xEA00 | ||
| J1939_PF_ADDRESS_CLAIMED = 0xEE | ||
| J1939_PF_REQUEST = 0xEA | ||
| TP_CM_RTS = J1939_TP_CTRL_RTS | ||
| TP_CM_CTS = J1939_TP_CTRL_CTS | ||
| TP_CM_EndOfMsgACK = J1939_TP_CTRL_ACK | ||
| TP_CM_BAM = J1939_TP_CTRL_BAM | ||
| TP_Conn_Abort = J1939_TP_CTRL_ABORT | ||
|
|
||
| from scapy.contrib.automotive.j1939.j1939_dm import ( | ||
| J1939_DTC, | ||
| J1939_DM1, | ||
| J1939_DM13, | ||
| J1939_DM14, | ||
| PGN_DM1, | ||
| PGN_DM13, | ||
| PGN_DM14, | ||
| sniff_dm1, | ||
| send_dm14_request, | ||
| ) | ||
|
|
||
| from scapy.contrib.automotive.j1939.j1939_scanner import ( | ||
| _j1939_can_id, | ||
| _j1939_decode_can_id, | ||
| J1939_TP_CM_PF, | ||
| j1939_scan, | ||
| j1939_scan_passive, | ||
| j1939_scan_addr_claim, | ||
| j1939_scan_ecu_id, | ||
| j1939_scan_unicast, | ||
| j1939_scan_rts_probe, | ||
| j1939_scan_uds, | ||
| j1939_scan_xcp, | ||
| J1939_DIAGADAPTERS_ADDRESSES, | ||
| J1939_XCP_SRC_ADDRS, | ||
| PGN_ECU_ID, | ||
| PGN_DIAG_A, | ||
| J1939_PF_DIAG_A, | ||
| PGN_DIAG_B, | ||
| J1939_PF_DIAG_B, | ||
| J1939_PF_XCP, | ||
| SCAN_METHODS, | ||
| ) | ||
|
|
||
| from scapy.contrib.automotive.j1939.j1939_dm_scanner import ( | ||
| DmScanResult, | ||
| J1939_DM_PGNS, | ||
| J1939_PF_ACK, | ||
| PGN_ACK, | ||
| j1939_scan_dm, | ||
| j1939_scan_dm_pgn, | ||
| ) | ||
|
|
||
|
|
||
| from scapy.contrib.automotive.j1939.j1939_name import ( | ||
| INDUSTRY_GROUPS, | ||
| PRE_ASSIGNED_FUNCTIONS, | ||
| INDUSTRY_SPECIFIC_FUNCTIONS, | ||
| INDUSTRY_SPECIFIC_VEHICLE_SYSTEMS, | ||
| MANUFACTURERS, | ||
| J1939NameDecoder, | ||
| J1939_NAME, | ||
| decode_j1939_name, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you unify this to j1939_decode_name
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm happy to comply. But I don't think I grok what the change requested is. You want me to rename decode_j1939_name -> j1939_decode_name ? |
||
| simulate_arbitration, | ||
| j1939_request_name, | ||
| j1939_request_names, | ||
| ) | ||
|
|
||
| J1939Socket = J1939SoftSocket | ||
|
|
||
| __all__ = [ | ||
| 'INDUSTRY_GROUPS', | ||
| 'PRE_ASSIGNED_FUNCTIONS', | ||
| 'INDUSTRY_SPECIFIC_FUNCTIONS', | ||
| 'INDUSTRY_SPECIFIC_VEHICLE_SYSTEMS', | ||
| 'MANUFACTURERS', | ||
| 'J1939NameDecoder', | ||
| 'J1939_NAME', | ||
| 'decode_j1939_name', | ||
| 'simulate_arbitration', | ||
| 'j1939_request_name', | ||
| 'j1939_request_names', | ||
| 'J1939', | ||
| 'J1939_CAN', | ||
| 'J1939SoftSocket', | ||
| 'NativeJ1939Socket', | ||
| 'J1939TPImplementation', | ||
| 'J1939Socket', | ||
| 'J1939_BROADCAST_ADDR', | ||
| 'J1939_GLOBAL_ADDRESS', | ||
| 'J1939_NULL_ADDRESS', | ||
| 'log_j1939', | ||
| 'J1939_DTC', | ||
| 'J1939_DM1', | ||
| 'J1939_DM13', | ||
| 'J1939_DM14', | ||
| 'PGN_DM1', | ||
| 'PGN_DM13', | ||
| 'PGN_DM14', | ||
| 'sniff_dm1', | ||
| 'send_dm14_request', | ||
| 'j1939_scan', | ||
| 'j1939_scan_passive', | ||
| 'j1939_scan_addr_claim', | ||
| 'j1939_scan_ecu_id', | ||
| 'j1939_scan_unicast', | ||
| 'j1939_scan_rts_probe', | ||
| 'j1939_scan_uds', | ||
| 'j1939_scan_xcp', | ||
| 'J1939_DIAGADAPTERS_ADDRESSES', | ||
| 'J1939_XCP_SRC_ADDRS', | ||
| 'PGN_ECU_ID', | ||
| 'PGN_DIAG_A', | ||
| 'J1939_PF_DIAG_A', | ||
| 'PGN_DIAG_B', | ||
| 'J1939_PF_DIAG_B', | ||
| 'J1939_PF_XCP', | ||
| 'SCAN_METHODS', | ||
| 'DmScanResult', | ||
| 'J1939_DM_PGNS', | ||
| 'J1939_PF_ACK', | ||
| 'PGN_ACK', | ||
| 'j1939_scan_dm', | ||
| 'j1939_scan_dm_pgn', | ||
| ] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here