scapy.contrib.automotive.gm.gmlan_scanner

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_DCEnumerator[source]

Bases: GMLAN_Enumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_IDOEnumerator[source]

Bases: GMLAN_Enumerator, StateGeneratingServiceEnumerator

static enter_diagnostic_session(socket: SuperSocket | SingleConversationSocket) bool[source]
static enter_state_with_tp(sock: SuperSocket | SingleConversationSocket, conf: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
get_new_edge(socket: SuperSocket | SingleConversationSocket, config: AutomotiveTestCaseExecutorConfiguration) Tuple[EcuState, EcuState] | None[source]
get_transition_function(socket: SuperSocket | SingleConversationSocket, edge: Tuple[EcuState, EcuState]) Tuple[Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration], bool] | None] | None[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_PMEnumerator[source]

Bases: GMLAN_Enumerator, StateGeneratingServiceEnumerator

static enter_state_with_tp(sock: SuperSocket | SingleConversationSocket, conf: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
execute(socket: SuperSocket | SingleConversationSocket, state: EcuState, timeout: int = 1, execution_time: int = 1200, **kwargs: Any) None[source]
get_new_edge(socket: SuperSocket | SingleConversationSocket, config: AutomotiveTestCaseExecutorConfiguration) Tuple[EcuState, EcuState] | None[source]
get_transition_function(socket: SuperSocket | SingleConversationSocket, edge: Tuple[EcuState, EcuState]) Tuple[Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration], bool] | None] | None[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RDBIEnumerator[source]

Bases: GMLAN_Enumerator

static print_information(resp: Packet) str[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RDBPIEnumerator[source]

Bases: GMLAN_Enumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RDEnumerator[source]

Bases: GMLAN_Enumerator, StateGeneratingServiceEnumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RMBAEnumerator[source]

Bases: GMLAN_Enumerator

execute(socket: SuperSocket | SingleConversationSocket, state: EcuState, **kwargs: Any) None[source]
Parameters:
  • timeout (integer or float) – Timeout until a response will arrive after a request

  • count (integer) – Number of request to be sent in one execution

  • execution_time (int) – Time in seconds until the execution of this enumerator is stopped.

  • state_allow_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is allowed. If provided, other states will not be executed.

  • state_block_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is blocked.

  • retry_if_none_received (bool) – Specifies if a request will be send again, if None was received (usually because of a timeout).

  • exit_if_no_answer_received (bool) – Specifies to finish the execution of this enumerator once None is received.

  • exit_if_service_not_supported (bool) – Specifies to finish the execution of this enumerator, once the negative return code ‘serviceNotSupported’ is received.

  • exit_scan_on_first_negative_response (bool) – Specifies to finish the execution once a negative response is received.

  • retry_if_busy_returncode (bool) – Specifies to retry a request, if the ‘busyRepeatRequest’ negative response code is received.

  • debug (bool) – Enables debug functions during execute.

  • stop_event (Event) – Signals immediate stop of the execution.

  • scan_range (list or tuple or range or iterable) – Specifies the identifiers to be scanned.

  • probe_width (int) – Memory size of a probe.

  • random_probes_len (int) – Number of probes.

  • sequential_probes_len (int) – Size of a memory block during sequential probing.

post_execute(socket: SuperSocket | SingleConversationSocket, state: EcuState, global_configuration: AutomotiveTestCaseExecutorConfiguration) None[source]
show(dump: bool = False, filtered: bool = True, verbose: bool = False) str | None[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_SAEnumerator[source]

Bases: GMLAN_Enumerator, StateGenerator

static evaluate_security_access_response(res: Packet | None, seed: Packet, key: Packet | None) bool[source]
execute(socket: SuperSocket | SingleConversationSocket, state: EcuState, **kwargs: Any) None[source]
Parameters:
  • timeout (integer or float) – Timeout until a response will arrive after a request

  • count (integer) – Number of request to be sent in one execution

  • execution_time (int) – Time in seconds until the execution of this enumerator is stopped.

  • state_allow_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is allowed. If provided, other states will not be executed.

  • state_block_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is blocked.

  • retry_if_none_received (bool) – Specifies if a request will be send again, if None was received (usually because of a timeout).

  • exit_if_no_answer_received (bool) – Specifies to finish the execution of this enumerator once None is received.

  • exit_if_service_not_supported (bool) – Specifies to finish the execution of this enumerator, once the negative return code ‘serviceNotSupported’ is received.

  • exit_scan_on_first_negative_response (bool) – Specifies to finish the execution once a negative response is received.

  • retry_if_busy_returncode (bool) – Specifies to retry a request, if the ‘busyRepeatRequest’ negative response code is received.

  • debug (bool) – Enables debug functions during execute.

  • stop_event (Event) – Signals immediate stop of the execution.

  • scan_range (list or tuple or range or iterable) – Specifies the identifiers to be scanned.

  • keyfunction (Callable[[int], int]) – Specifies a function to generate the key from a given seed.

static get_key_pkt(seed: Packet, keyfunction: Callable[[int], int], level: int = 1) Packet | None[source]
get_new_edge(socket: SuperSocket | SingleConversationSocket, config: AutomotiveTestCaseExecutorConfiguration) Tuple[EcuState, EcuState] | None[source]
static get_security_access(sock: SuperSocket | SingleConversationSocket, level: int = 1, seed_pkt: Packet | None = None, keyfunction: Callable[[int], int] | None = None) bool[source]
static get_seed_pkt(sock: SuperSocket | SingleConversationSocket, level: int = 1) Packet | None[source]
get_transition_function(socket: SuperSocket | SingleConversationSocket, edge: Tuple[EcuState, EcuState]) Tuple[Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration], bool] | None] | None[source]
pre_execute(socket: SuperSocket | SingleConversationSocket, state: EcuState, global_configuration: AutomotiveTestCaseExecutorConfiguration) None[source]
static transition_function(sock: SuperSocket | SingleConversationSocket, _: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Scanner(socket: SuperSocket | SingleConversationSocket, reset_handler: Callable[[], None] | None = None, reconnect_handler: Callable[[], SuperSocket | SingleConversationSocket] | None = None, test_cases: List[AutomotiveTestCaseABC | Type[AutomotiveTestCaseABC]] | None = None, **kwargs: Dict[str, Any] | None)[source]

Bases: AutomotiveTestCaseExecutor

property default_test_case_clss: List[Type[AutomotiveTestCaseABC]]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_ServiceEnumerator[source]

Bases: GMLAN_Enumerator, StateGeneratingServiceEnumerator

This enumerator scans for all services identifiers of GMLAN. During this scan, corrupted packets might be sent to an ECU and mainly negative responses will be received.

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_TDEnumerator[source]

Bases: GMLAN_Enumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_TPEnumerator[source]

Bases: GMLAN_Enumerator, StateGeneratingServiceEnumerator

Performs a check if TesterPresent is available. If a positive response is received, a new system state is generated and returned.

static cleanup(_: SuperSocket | SingleConversationSocket, configuration: AutomotiveTestCaseExecutorConfiguration) bool[source]
static enter(socket: SuperSocket | SingleConversationSocket, configuration: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
get_transition_function(socket: SuperSocket | SingleConversationSocket, edge: Tuple[EcuState, EcuState]) Tuple[Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Callable[[SuperSocket | SingleConversationSocket, AutomotiveTestCaseExecutorConfiguration], bool] | None] | None[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_WDBIEnumerator[source]

Bases: GMLAN_Enumerator

execute(socket: SuperSocket | SingleConversationSocket, state: EcuState, **kwargs: Any) None[source]
Parameters:
  • timeout (integer or float) – Timeout until a response will arrive after a request

  • count (integer) – Number of request to be sent in one execution

  • execution_time (int) – Time in seconds until the execution of this enumerator is stopped.

  • state_allow_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is allowed. If provided, other states will not be executed.

  • state_block_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is blocked.

  • retry_if_none_received (bool) – Specifies if a request will be send again, if None was received (usually because of a timeout).

  • exit_if_no_answer_received (bool) – Specifies to finish the execution of this enumerator once None is received.

  • exit_if_service_not_supported (bool) – Specifies to finish the execution of this enumerator, once the negative return code ‘serviceNotSupported’ is received.

  • exit_scan_on_first_negative_response (bool) – Specifies to finish the execution once a negative response is received.

  • retry_if_busy_returncode (bool) – Specifies to retry a request, if the ‘busyRepeatRequest’ negative response code is received.

  • debug (bool) – Enables debug functions during execute.

  • stop_event (Event) – Signals immediate stop of the execution.

  • scan_range (list or tuple or range or iterable) – Specifies the identifiers to be scanned.

  • rdbi_enumerator (GMLAN_RDBIEnumerator) – Specifies an instance of a GMLAN_RDBIEnumerator which is used to extract possible data identifiers.

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_WDBISelectiveEnumerator[source]

Bases: StagedAutomotiveTestCase