scapy.contrib.isotp.isotp_packet
- class scapy.contrib.isotp.isotp_packet.ISOTP(_pkt, /, *, data=b'')[source]
Bases:
Packet
Packet class for ISOTP messages. This class contains additional slots for source address (tx_id), destination address (rx_id), extended source address (ext_address) and extended destination address (rx_ext_address) information. This information gets filled from ISOTPSockets or the ISOTPMessageBuilder, if it is available. Address information is not used for Packet comparison.
- Parameters
args – Arguments for Packet init, for example bytes string
kwargs – Keyword arguments for Packet init.
- aliastypes
- comment: Optional[bytes]
- default_fields: Dict[str, Any]
- static defragment(can_frames: List[Packet], use_extended_addressing: Optional[bool] = None) Optional[ISOTP] [source]
Helper function to defragment a list of CAN frames to one ISOTP message
- Parameters
can_frames – A list of CAN frames
use_extended_addressing – Specify if extended ISO-TP addressing is used in the packets for defragmentation.
- Returns
An ISOTP message containing the data of the CAN frames or None
- direction: Optional[int]
- explicit
- ext_address: Optional[int]
- fields: Dict[str, Any]
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. ISOTP
data
b''
- fieldtype: Dict[str, AnyField]
- fragment(*args: Any, **kargs: Any) List[Packet] [source]
Helper function to fragment an ISOTP message into multiple CAN frames.
- Returns
A list of CAN frames
- name
- original
- overloaded_fields: Dict[str, Any]
- packetfields: List[AnyField]
- parent
- payload
- post_transforms
- raw_packet_cache: Optional[bytes]
- raw_packet_cache_fields: Optional[Dict[str, Any]]
- rx_ext_address: Optional[int]
- rx_id: Optional[int]
- sniffed_on: Optional[_GlobInterfaceType]
- tx_id: Optional[int]
- underlayer
- validate_fields() None [source]
Helper function to validate information in tx_id, rx_id, ext_address and rx_ext_address slots
- wirelen: Optional[int]
- class scapy.contrib.isotp.isotp_packet.ISOTPHeader(_pkt, /, *, flags=<Flag 0 ()>, identifier=0, length=None, reserved=0)[source]
Bases:
CAN
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |FLAGS| IDENTIFIER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LENGTH | RESERVED | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Fig. ISOTPHeader
flags
<Flag 0 ()>
identifier
XBitField
(29 bits)0
length
None
reserved
0
- class scapy.contrib.isotp.isotp_packet.ISOTPHeaderEA(_pkt, /, *, flags=<Flag 0 ()>, identifier=0, length=None, reserved=0, extended_address=0)[source]
Bases:
ISOTPHeader
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |FLAGS| IDENTIFIER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LENGTH | RESERVED | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |EXTENDED ADDRES| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. ISOTPHeaderEA
flags
<Flag 0 ()>
identifier
XBitField
(29 bits)0
length
None
reserved
0
extended_address
0
- class scapy.contrib.isotp.isotp_packet.ISOTP_CF(_pkt, /, *, type=2, index=0, data=b'')[source]
Bases:
Packet
- aliastypes
- class scapy.contrib.isotp.isotp_packet.ISOTP_FC(_pkt, /, *, type=3, fc_flag=0, block_size=0, separation_time=0)[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE |FC FLAG| BLOCK SIZE |SEPARATION TIME| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. ISOTP_FC
type
3
fc_flag
0
block_size
0
separation_time
0
- class scapy.contrib.isotp.isotp_packet.ISOTP_FF(_pkt, /, *, type=1, message_size=0, extended_message_size=0, data=b'')[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | MESSAGE SIZE | EXTENDED MESSAGE SIZE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. ISOTP_FF
type
1
message_size
BitField
(12 bits)0
extended_message_size
BitField
(Cond) (32 bits)0
data
b''
- class scapy.contrib.isotp.isotp_packet.ISOTP_SF(_pkt, /, *, type=0, message_size=None, data=b'')[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE |MESSAGE| DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. ISOTP_SF
type
0
message_size
BitFieldLenField
(4 bits)None
data
b''