Options
All
  • Public
  • Public/Protected
  • All
Menu

Discovers and documents all hosts that can be reached from "home".

Hierarchy

  • Scanner

Index

Constructors

  • Creates a new host scanner, which keeps track of all known hosts.

    Parameters

    • ns: NS

      The Netscript object.

    Returns Scanner

Properties

_hostMap: {} = {}

Mapping to IHost object containing information on the hosts.

Type declaration

_hostnames: string[] = []

All known hostnames.

_ns: NS

The Netscript object.

_workers: string[] = []

List of purchased workers.

Methods

  • _isWorker(hostname: string, updateWorker?: boolean): boolean
  • Checks whether hostname is a worker.

    Parameters

    • hostname: string

      The hostname to check.

    • updateWorker: boolean = true

    Returns boolean

    Whether the hostname is a worker or other host.

  • _updateHost(hostname: string, route?: string[]): IHost
  • Update host information in _hostMap.

    Parameters

    • hostname: string

      The hostname of the host to update.

    • route: string[] = ...

      The route to host. If not provided, existing route is used.

    Returns IHost

    Host object for hostname, after it is updated.

  • _updateHosts(): string[]
  • Updates all hosts, both the _hostnames list and the _hostMap mapping.

    Returns string[]

    All discovered hostnames.

  • _updateWorkers(): string[]
  • Updates the list of purchased workers.

    Returns string[]

    Current list of workers.

  • getHost(hostname: string): IHost
  • Get host object for hostname.

    Parameters

    • hostname: string

      The hostname to update and lookup.

    Returns IHost

    The host object for hostname.

  • getHostnames(scanType: ScanType): string[]
  • Get all hostnames based on provided scanType.

    Parameters

    • scanType: ScanType

      The scan to perform.

    Returns string[]

    All hostnames, according to the scanType.

  • Get all host objects based on provided scanType.

    Parameters

    • scanType: ScanType

      The scan to perform.

    Returns IHost[]

    All host objects, according to the scanType.

Generated using TypeDoc