scapy.contrib.cansocket_native
NativeCANSocket.
- scapy.contrib.cansocket_native.CANSocket[源代码]
NativeCANSocket
的别名
- class scapy.contrib.cansocket_native.NativeCANSocket(channel: str | None = None, receive_own_messages: bool = False, can_filters: ~typing.List[~typing.Dict[str, int]] | None = None, fd: bool = False, basecls: ~typing.Type[~scapy.packet.Packet] = <class 'scapy.layers.can.CAN'>, **kwargs: ~typing.Dict[str, ~typing.Any])[源代码]
基类:
SuperSocket
Initializes a Linux PF_CAN socket object.
示例
>>> socket = NativeCANSocket(channel="vcan0", can_filters=[{'can_id': 0x200, 'can_mask': 0x7FF}])
- 参数:
channel -- Network interface name
receive_own_messages -- Messages, sent by this socket are will also be received.
can_filters -- A list of can filter dictionaries.
basecls -- Packet type in which received data gets interpreted.
kwargs -- Various keyword arguments for compatibility with PythonCANSockets
- desc = 'read/write packets at a given CAN interface using PF_CAN sockets'