Npdu Configurator Module
- class mtf.network_port.npdu_configurator.NPduConfigurator
- __init__()
- parse_brcf_file(file_path: str)
Parse the BRCF file.
- Parameters:
file_path – BRCF file path.
- Returns:
True if BRCF file parsed, else False.
- gw_database(file_path: str)
Parse the gw database file.
- Parameters:
file_path – gw_database file path.
- Returns:
True if gw_database file parsed, else False.
- parse_drcf_file(drcf_file_path: str, brcf_path: str, ecu_name: str, drcf_channel: str)
Parse the DRCF file.
- Parameters:
drcf_file_path – DRCF file path.
brcf_path – BRCF file path
ecu_name – ECU name
drcf_channel – DRCF channel name
- Returns:
True if DRCF file was parsed, else False.
- services_gw_databases(services_gw_database: str, gw_database: str, ecu_name: str, services_gw_database_channel: str)
Parse the services gw database file.
- Parameters:
services_gw_database – services gw database file path.
gw_database – gw database file path
ecu_name – ECU name
channel (services gw database) – services_gw_database channel name
- Returns:
True if services_gw_database file was parsed, else False.
- get_list_of_pdus(ecu)
Get the list of the pdus corresponding to the ECU.
- Parameters:
ecu – name of the ecu.
- Returns:
List of pdus
- configure_tunnels(ecu_name: str, local_ip: str, adapter_name: str, input_local_port: int, vlan_assign: bool = True, listener_channel_name: str | None = None)
Configure all the tunnels corresponding to ecu_name.
- Parameters:
ecu_name – ecu name from BRCF file.
local_ip – local ip address.
adapter_name – adapter name
input_local_port – input local port number.
listener_channel_name – adapter name to listen over it
- configure_input_tunnel(channel_name: str, multi_cast_ip_v4_addresses: list, multi_cast_port: int, adapter_name, remote_ip_v4_address: str, local_port: int = 0, with_vlan_assign=True)
Configure the input tunnel.
- Parameters:
channel_name – tunnel name
multi_cast_ip_v4_addresses – list of ipv4 addresses
multi_cast_port – port number
adapter_name – adapter name
remote_ip_v4_address – remote ip address
local_port – local port number.
with_vlan_assign – Flag to add a vlan to the packets . Default to True.
- configure_output_tunnel(channel_name: str, multi_cast_ip_v4_addresses: list, multi_cast_port: int, transmission_timeout: int, adapter_name: str, local_ip: str, local_port: int = 0)
Configure the output tunnel.
- Parameters:
channel_name – tunnel name
multi_cast_ip_v4_addresses – list of ipv4 addresses
multi_cast_port – port number
transmission_timeout – transmission timeout
adapter_name – adapter name
local_ip – local ip address
local_port – local port number.
- assign_vlan_tag_to_tunnel(channel_name, tunnel_name, vlan_id, cfi, priority)
Assign a vlan tag to the tunnel.
- Parameters:
channel_name – name of adapter name
tunnel_name – name of Npdu tunnel
vlan_id – vlan identifier
cfi – CFI value
priority – priority value
- Returns:
True if listener is started. False otherwise.
- remove_tunnel_from_configuration(tunnel_id)
Remove the tunnel from configuration.
- Parameters:
tunnel_id – identifier of Npdu tunnel
- finilize_configuration()
Start the Npdu manager.
- cleanup_configuration()
Cleanup the configuration by stopping the Npdu manager.