Protector07

class mtf.network_port.e2e_protection.Protector07

E2EProtector implementation with specific configuration (Profile 07).

__init__() None
configure(data_id: int, offset: int, min_data_length: int = 160, max_data_length: int = 4294967288, max_delta_counter: int = 0) bool

Configure the Protector with specific parameters (Profile 07).

Returns:

bool: True if the configuration is valid, False otherwise.

check(payload: list[int]) bool

Check the payload integrity using the configured E2EProtector.

Args:

payload (list[int]): The payload to check.

Returns:

bool: True if the payload is valid, False if not.

Raises:

NotConfiguredError: If the Protector is not configured.

get_last_check_status() str

Get the last check status from the receiver state.

Returns:

str: The last check status as a string.

increment_counter(counter: int, step: int = 1) int

Increments the given counter by the specified step using the configured E2EProtector.

Args:

counter (int): The counter value to increment. step (int): The step by which to increment the counter. If the value is

greater than or equal to 0, the counter will increase. If the value is negative, the counter will decrease. Defaults to 1.

Returns:

int: The incremented counter value.

Raises:

NotConfiguredError: If the Protector is not configured.

protect(payload: list[int]) bool

Protect the payload using the configured E2EProtector.

Args:

payload (list[int]): The payload to protect.

Returns:

bool: True if the payload is protected successfully, False if not.

Raises:

NotConfiguredError: If the Protector is not configured.

set_option(option: E2EProtectorOptions, is_set: bool = True) None

Set or unset a specific option for the configured E2EProtector.

Args:

option (E2EProtectorOptions): The option to set or unset. is_set (bool): True to set the option, False to unset.

Raises:

NotConfiguredError: If the Protector is not configured.