aztarna.ros.sros package¶
Submodules¶
aztarna.ros.sros.helpers module¶
SROS Scanner helpers classes module. :author Alias Robotics SL (https://aliasrobotics.com)
-
class
aztarna.ros.sros.helpers.
SROSHost
[source]¶ Bases:
aztarna.ros.commons.BaseHostROS
Class for keeping all the attributes of a SROS Node.Extends:class:aztarna.commons.BaseHostROS
-
class
aztarna.ros.sros.helpers.
SROSNode
[source]¶ Bases:
aztarna.ros.commons.BaseNodeROS
Class for keeping all the attributes of a SROS Node. Extends
aztarna.commons.BaseNodeROS
-
class
aztarna.ros.sros.helpers.
SROSPolicy
[source]¶ Bases:
object
Class for representing a SROS Policy, containing the possible types for it, the value and its permissions.
-
POLICY_ALLOWED
= True¶
-
POLICY_DENIED
= False¶
-
TYPE_EXECUTABLE_SVCS
= 'Executable services'¶
-
TYPE_PUBLISHABLE_TOPICS
= 'Publishable topics'¶
-
TYPE_READABLE_PARAMS
= 'Readable parameters'¶
-
TYPE_SUBSCRIPTABLE_TOPICS
= 'Subscriptable topics'¶
-
TYPE_UNKNOWN
= 'Unknown'¶
-
-
aztarna.ros.sros.helpers.
check_port
(ip, port)[source]¶ Check if a port is open. :param ip: Address of the host :param port: Port to check :return: Returns the port if it is open. None otherwise.
-
aztarna.ros.sros.helpers.
check_port_sem
(sem, ip, port)[source]¶ Check ports from a host, limiting concurrency with a semaphore.
- Parameters
sem – Asyncio semaphore.
ip – Address of the host.
port – Port to be checked.
- Returns
The result of
aztarna.sros.helpers.check_port()
.
-
aztarna.ros.sros.helpers.
find_node_ports
(address, ports)[source]¶ Find all the open ports for a host.
- Parameters
address – IP address of the host.
ports – Port to check.
- Returns
A list of the found open ports.
-
aztarna.ros.sros.helpers.
get_node_info
(cert)[source]¶ Extract all the information for a node, based on it’s certificate. :param cert: The input certificate in X509 format. :return:
aztarna.sros.helpers.SROSNode
The extracted node info from the certificate.
-
aztarna.ros.sros.helpers.
get_policies
(cert)[source]¶ Get the related policies from an input SROS Node certificate. :param cert: Certificate in X509 format. :return: List containing all policies as instances of
aztarna.sros.helpers.SROSPolicy
-
aztarna.ros.sros.helpers.
get_sros_certificate
(address, port, timeout=3)[source]¶ Function to connect to a SROS Node, simulate the TLS handshake, and get it’s server certificate on the process. :param address: Address of the node. :param port: Port of the node. :param timeout: Timeout for the connection. :return: A tuple containing the address, port and certificate if found, otherwise, a tuple containing address, port and None.
aztarna.ros.sros.scanner module¶
SROS Scanner module.
:author Alias Robotics SL (https://aliasrobotics.com)
-
class
aztarna.ros.sros.scanner.
SROSScanner
[source]¶ Bases:
aztarna.commons.RobotAdapter
SROS Scanner class, extending
aztarna.commons.BaseScanner
.-
print_results
()[source]¶ Print the results of the scan into console. Extended from
aztarna.commons.BaseScanner
.
-
scan
()[source]¶ Run the scan for SROS hosts. Extended from
aztarna.commons.BaseScanner
. This function is the one to be called externally in order to run the scans. Internally those scans are run with the help of asyncio.
-
scan_host
(address: str, master_port: int, timeout=1)[source]¶ Scan a single SROS host and return a
aztarna.sros.helpers.SROSHost
instance with all the data if found.- Parameters
address – Host IP address.
master_port – Master node port.
timeout – Timeout for the connection.
- Returns
aztarna.sros.helpers.SROSHost
instance.
-