Solaris System Management Agent Developer's Guide

Physical Contains Table Functions

The entPhysicalContainsTable exposes the container relationships between physical entities. This table provides the same information that can be found by constructing the virtual containment tree for a given entPhysicalTable, but in a more direct format.

The following functions are for use with the entPhysicalContainsTable in the Entity MIB:

addPhysicalContainsTableEntry()

Synopsis

extern int addPhysicalContainsTableEntry(int entPhysicalIndex, int childIndex);

Description

Adds an entry to the entPhysicalContainsTable table for the specified entPhysicalIndex and childIndex. The entPhysicalContainedIn OID that is present in the entPhysicalTable for the childIndex might be replaced by the OID for entPhysicalIndex. The OID is replaced if the entPhysicalIndex has a lower index than the original index.

Returns

0

for successful addition.

-1

for failure to add.

-2

for stale index.

1

if the entry already exists for the specified entPhysicalIndex and childIndex.

deletePhysicalContainsTableEntry()

Synopsis

extern int deletePhysicalContainsTableEntry(int parentIndex, int childIndex);

Description

Deletes the parentIndex or childIndex entry that is present in the entPhysicalContainsTable.

Returns

0

for success.

-1

for failure.

-2

for stale entry, either parent or child, or both.

deletePhysicalContainsParentIndex()

Synopsis

extern int deletePhysicalContainsParentIndex(int parentIndex);

Description

Deletes all entries in the entPhysicalContainsTable where the parent index is equal to the specified parentIndex.

Returns

number

of children successfully deleted for the specified parent.

-1

for failure.

-2

for stale parent entry.

deletePhysicalContainsChildIndex()

Synopsis

extern int deletePhysicalContainsChildIndex(int childIndex);

Description

Deletes all entries in the entPhysicalContains table where the child index is equal to the specified childIndex.

Returns

number

of parents successfully deleted for the specified child.

-1

for failure.

-2

for stale child entry.

getPhysicalContainsChildren()

Synopsis

extern int getPhysicalContainsChildren(int parentIndex);

Description

Get the indexes for all the children of the specified parent in the entPhysicalContainsTable.

Returns

Returns an array of integer indexes, with null termination.

Returns NULL if children exist, or if not enough memory exists when allocating the array. The array is a copy that should be freed when done.