NAME

Nmap::Scanner::Processor - This is the base class for output processors for Nmap::Scanner.


register_scan_complete_event()

Use this to tell the backend processor you want to be notified when the scan of a HOST is complete.

Pass in a reference to a function that will receive two arguments when called: A reference to the calling object and a reference to an Nmap::Scanner::Host instance.


register_scan_started_event()

Use this to tell the backend processor you want to be notified when the scan of a HOST has started.

Pass in a reference to a function that will receive two arguments when called: A reference to the calling object and a reference to an Nmap::Scanner::Host instance.


register_host_closed_event()

Use this to tell the backend processor you want to be notified when nmap has determined that the current host is not available (up).

Pass in a reference to a function that will receive two arguments when called: A reference to the calling object and a reference to an Nmap::Scanner::Host instance.


register_port_found_event()

Use this to tell the backend processor you want to be notified when an open port has been found on the current host being scanned.

Pass in a reference to a function that will receive three arguments when called: A reference to the calling object, a reference to an Nmap::Scanner::Host instance, and a reference to an Nmap::Scanner::Port containing information on the port.


register_no_ports_open_event()

Use this to tell the backend processor you want to be notified when the scan of a HOST has yielded NO open ports.

Pass in a reference to a function that will receive three arguments when called: A reference to the calling object, a reference to an Nmap::Scanner::Host instance, and a reference to an Nmap::Scanner::ExtraPorts instance with some information on the states of the non-open ports.


register_task_started_event()

Use this to tell the backend processor you want to be notified when an nmap task has started.

Pass in a reference to a function that will receive two arguments when called: A reference to the calling object and a reference to an Nmap::Scanner::Task instance. Note that since this is the begin part of a task end_time() will be undefined.


register_task_ended_event()

Use this to tell the backend processor you want to be notified when an nmap task has ended.

Pass in a reference to a function that will receive two arguments when called: A reference to the calling object and a reference to an Nmap::Scanner::Task instance.


register_task_progress_event()

Use this to tell the backend processor you want to be notified when an nmap task progress event occurs.

Pass in a reference to a function that will receive two arguments when called: A reference to the calling object and a reference to an Nmap::Scanner::TaskProgress instance.


results()

Return the Nmap::Scanner::Results instance created by the scan.


start_nmap()

This method may be called by the user. It starts the nmap process using the options set by the user via the scan() method or setters of Nmap::Scanner::Scanner. The method returns the PID of the child nmap process, a reader handle to read from the nmap process, a write handle to write to nmap, and an error handle which will contain data if nmap throws an error.

Example code:

sub process {

    my $self = shift;
    my $cmdline = shift;

    my ($pid, $in, $out, $err) = $self->SUPER::start_nmap($cmdline);

    #  Process filehandles

}


start_nmap2()

This method is called by the sub-classed processor to start the nmap process using options set by the user via the scan() method or setters of Nmap::Scanner::Scanner. The sub-classed processor is returned the PID of the child nmap process and a reader handle to read from the nmap process.

Example code:

sub process {

    my $self = shift;
    my $cmdline = shift;

    my ($pid, $in) = $self->SUPER::start_nmap2($cmdline);

    #  Process filehandles

}


notify_scan_started()

Notify the listener that a scan started event has occurred. Caller is passed a reference to the callers self reference (object instance) and an Nmap::Scanner::Host instance.


notify_scan_complete()

Notify the listener that a scan complete event has occurred. Caller is passed a reference to the callers self reference (object instance) and an Nmap::Scanner::Host instance.


notify_scan_started()

Notify the listener that a port found event has occurred. Caller is passed a reference to the callers self reference (object instance), an Nmap::Scanner::Host instance, and an Nmap::Scanner::Port instance.


notify_no_ports_open()

Notify the listener that a scan started event has occurred. Caller is passed a reference to the callers self reference (object instance), an Nmap::Scanner::Host instance, and an Nmap::Scanner::ExtraPorts instance.


notify_task_started()

Notify the listener that an nmap task begin (taskbegin) event has occurred. Caller is passed a reference to the callers self reference (object instance) and an Nmap::Scanner::Task instance.


notify_task_ended()

Notify the listener that an nmap task end (taskend) event has occurred. Caller is passed a reference to the callers self reference (object instance) and an Nmap::Scanner::Task instance.


notify_task_progress()

Notify the listener that an nmap task end (taskend) event has occurred. Caller is passed a reference to the callers self reference (object instance) and an Nmap::Scanner::TaskProgress instance.