Network scanner - Targets parser

codestral_ros2_gen.network_scan.network_parser.parse_network_targets(network_spec)[source]

Parse various network target specifications and return a list of host IP addresses.

Supported formats:
  • Standard CIDR: “192.168.1.0/24”

  • IP range: “192.168.1.1-192.168.1.254”

  • Single IP: “192.168.1.1”

  • Multiple networks: “192.168.1.0/24,10.0.0.0/16”

  • Octet ranges: “192.168.10-20.1-254”

  • Wildcard notation: “192.168.1.*”

Parameters:

network_spec (str) – String specifying network(s) to scan

Returns:

List of IP addresses to scan

Return type:

List[str]

Raises:
  • ValueError – If the network specification is not in a recognized format.

  • TypeError – If the network specification contains invalid types.