Oliver Gorwits > App-Netdisco-2.026000 > App::Netdisco::Util::Node

Download:
App-Netdisco-2.026000.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: App-Netdisco-2.029007

NAME ^

App::Netdisco::Util::Node

DESCRIPTION ^

A set of helper subroutines to support parts of the Netdisco application.

There are no default exports, however the :all tag will export all subroutines.

EXPORT_OK ^

check_mac( $device, $node, $port_macs? )

Given a Device database object and a MAC address, perform various sanity checks which need to be done before writing an ARP/Neighbor entry to the database storage.

Returns false, and might log a debug level message, if the checks fail.

Returns a true value if these checks pass:

Optionally pass a cached set of Device port MAC addresses as the third argument, in which case an additional check is added:

check_node_no( $ip, $setting_name )

Given the IP address of a node, returns true if the configuration setting $setting_name matches that device, else returns false. If the setting is undefined or empty, then check_node_no also returns false.

 print "rejected!" if check_node_no($ip, 'nbtstat_no');

There are several options for what $setting_name can contain:

To simply match all nodes, use "any" or IP Prefix "0.0.0.0/0". All regular expressions are anchored (that is, they must match the whole string). To match no nodes we recommend an entry of "localhost" in the setting.

check_node_only( $ip, $setting_name )

Given the IP address of a node, returns true if the configuration setting $setting_name matches that node, else returns false. If the setting is undefined or empty, then check_node_only also returns true.

 print "rejected!" unless check_node_only($ip, 'nbtstat_only');

There are several options for what $setting_name can contain:

To simply match all nodes, use "any" or IP Prefix "0.0.0.0/0". All regular expressions are anchored (that is, they must match the whole string). To match no nodes we recommend an entry of "localhost" in the setting.

is_nbtstatable( $ip )

Given an IP address, returns true if Netdisco on this host is permitted by the local configuration to nbtstat the node.

The configuration items nbtstat_no and nbtstat_only are checked against the given IP.

Returns false if the host is not permitted to nbtstat the target node.

syntax highlighting: