RIV::Record module overview
The RIV::Record module provides a data
structure to store network entity data records.
Network entities
The RIV::Record module
is used in conjunction with the RIV::Agent module
to write discovery agents. The RIV::Record data structure
stores records associated with the network entities sent by DISCO
to the Perl Discovery Agent. You can then add local neighbors and
remote neighbors to this record by calling the appropriate local and
remote neighbor operation methods.
RIV::Record constructor
Before accessing
the methods that the RIV::Record module provides,
you must call the RIV::Record constructor to create
and initialize a new RIV::Record data structure.
This data structure stores network entity records retrieved from DISCO.
RIV::Record data structure
The following
respresents a RIV::Record data structure:
$refLocalNeighbours = $record->{m_LocalNbr};
@LocalNeighbours = @$refLocalNeighbours;
$refRemoteNeighbours = $LocalNeighbours[$i]->{m_RemoteNbr};
@RemoteNeighbours = @$refRemoteNeighbours;
$refRemoteNeighbour = $RemoteNeighbours[$j];
%remoteNeighbour = %$refRemoteNeighbour;The value for
the key m_LocalNbr is a pointer to an array, which
is a list of hashes, where each hash represents a local neighbor.
If there are any remote neighbors, the local neighbor has a key (m_RemoteNbr)
whose value points to the reference of an array, which is a list of
hashes, each representing a remote neighbor. You will need this data
structure if you intend to manipulate it directly. In most cases,
however, your task is limited to creating hash lists that define the
local and remote neighbors.
The AddLocalNeighbour and AddRemoteNeighbour methods
can be used to add neighbors, and the GetLocalNeighbours and GetRemoteNeighbours methods
can be used to retrieve information about neighbors.
Local and remote neighbor operation methods
The RIV::Record module
provides methods that discovery agents use to perform add and get
operations on local and remote neighbors.
The following table
identifies and briefly describes the local and remote operation methods
that the RIV::Record module provides:
| Local and remote neighbor method | Description |
|---|---|
|
Adds a local neighbor. |
|
Adds a tag to a local neighbor. |
|
Adds a remote neighbor. |
|
Adds a tag to a remote neighbor. |
|
Returns an array of local neighbors. |
|
Returns an array of remote neighbors. |
|
Prints the current record. |
See RIV::Record module reference for the reference (man) pages associated with these methods.