scapy.contrib.automotive.gm.gmlan_scanner
- class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_IDOEnumerator[source]
Bases:
GMLAN_Enumerator
,StateGeneratingServiceEnumerator
- static enter_diagnostic_session(socket: Union[SuperSocket, SingleConversationSocket]) bool [source]
- static enter_state_with_tp(sock: Union[SuperSocket, SingleConversationSocket], conf: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool [source]
- get_new_edge(socket: Union[SuperSocket, SingleConversationSocket], config: AutomotiveTestCaseExecutorConfiguration) Optional[Tuple[EcuState, EcuState]] [source]
- get_transition_function(socket: Union[SuperSocket, SingleConversationSocket], edge: Tuple[EcuState, EcuState]) Optional[Tuple[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration], bool]]]] [source]
- class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_PMEnumerator[source]
Bases:
GMLAN_Enumerator
,StateGeneratingServiceEnumerator
- static enter_state_with_tp(sock: Union[SuperSocket, SingleConversationSocket], conf: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool [source]
- execute(socket: Union[SuperSocket, SingleConversationSocket], state: EcuState, timeout: int = 1, execution_time: int = 1200, **kwargs: Any) None [source]
- get_new_edge(socket: Union[SuperSocket, SingleConversationSocket], config: AutomotiveTestCaseExecutorConfiguration) Optional[Tuple[EcuState, EcuState]] [source]
- get_transition_function(socket: Union[SuperSocket, SingleConversationSocket], edge: Tuple[EcuState, EcuState]) Optional[Tuple[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration], bool]]]] [source]
- class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RDBIEnumerator[source]
Bases:
GMLAN_Enumerator
- 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: Union[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: Union[SuperSocket, SingleConversationSocket], state: EcuState, global_configuration: AutomotiveTestCaseExecutorConfiguration) None [source]
- class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_SAEnumerator[source]
Bases:
GMLAN_Enumerator
,StateGenerator
- static evaluate_security_access_response(res: Optional[Packet], seed: Packet, key: Optional[Packet]) bool [source]
- execute(socket: Union[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) Optional[Packet] [source]
- get_new_edge(socket: Union[SuperSocket, SingleConversationSocket], config: AutomotiveTestCaseExecutorConfiguration) Optional[Tuple[EcuState, EcuState]] [source]
- static get_security_access(sock: Union[SuperSocket, SingleConversationSocket], level: int = 1, seed_pkt: Optional[Packet] = None, keyfunction: Optional[Callable[[int], int]] = None) bool [source]
- static get_seed_pkt(sock: Union[SuperSocket, SingleConversationSocket], level: int = 1) Optional[Packet] [source]
- get_transition_function(socket: Union[SuperSocket, SingleConversationSocket], edge: Tuple[EcuState, EcuState]) Optional[Tuple[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration], bool]]]] [source]
- pre_execute(socket: Union[SuperSocket, SingleConversationSocket], state: EcuState, global_configuration: AutomotiveTestCaseExecutorConfiguration) None [source]
- static transition_function(sock: Union[SuperSocket, SingleConversationSocket], _: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool [source]
- class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Scanner(socket: Union[SuperSocket, SingleConversationSocket], reset_handler: Optional[Callable[[], None]] = None, reconnect_handler: Optional[Callable[[], Union[SuperSocket, SingleConversationSocket]]] = None, test_cases: Optional[List[Union[AutomotiveTestCaseABC, Type[AutomotiveTestCaseABC]]]] = None, **kwargs: Optional[Dict[str, Any]])[source]
Bases:
AutomotiveTestCaseExecutor
- property default_test_case_clss
- 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_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(_: Union[SuperSocket, SingleConversationSocket], configuration: AutomotiveTestCaseExecutorConfiguration) bool [source]
- static enter(socket: Union[SuperSocket, SingleConversationSocket], configuration: AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool [source]
- get_transition_function(socket: Union[SuperSocket, SingleConversationSocket], edge: Tuple[EcuState, EcuState]) Optional[Tuple[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[SuperSocket, SingleConversationSocket], AutomotiveTestCaseExecutorConfiguration], bool]]]] [source]
- class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_WDBIEnumerator[source]
Bases:
GMLAN_Enumerator
- execute(socket: Union[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