rancid − rancid perl module
rancid library provides functions for handling
rancid.types configuration files, loading modules, and the
basic global variables, variables from parsing rancid.types
files, and output handling functions that are common to all
rancid device modules, all of which are "exported"
(in perl terms) for use by those that import the module.
Specifically, the library is used by rancid(1), but
it could be used by any perl program for site-specific
handling or additional automata.
RunCommand(*INPUT, *OUTPUT, command)
Parse a single command that returns no required info; the output is dropped. This could be used as the processing function in a command definition in a rancid.types file.
ProcessHistory([tag], [sort_function], [sort_function_argument],
If the optional tag string and sort_function arguments are omitted, the string is output immediately. Otherwise, the strings are accumulated in a hash, by the hash key sort_function_argument, each time ProcessHistory() is called until the tag or sort_function changes, at which time the queue is flushed and the new string is handled. If sort_function had been supplied, it is called with the hash as its argument.
Note that if the hash key sort_function_argument exists, the new strings is appended to the existing hash value.
A sort routine that will sort on the keys of a hash as if it were a normal array. For example:
B0 and D0 are the sort keys.
A sort routine that will sort on the values of a hash as if it were a normal array.
A numerical sort routine (ascending).
ipsort(IPv4 dotted-quad/v6 address)
A sort routine that will sort on the ip address when the IP address is anywhere in the strings.
A sort routine that will sort based upon IPv4/v6 addresses.
Please see the library code for exported variables.