Solaris System Management Agent Developer's Guide

Logical Table Functions

The entLogicalTable table contains one row per logical entity. For agents that implement more than one naming scope, at least one entry must exist. Agents that instantiate all MIB objects within a single naming scope are not required to implement this table.

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

allocLogicalEntry()

Synopsis

extern int allocLogicalEntry(int logidx, entLogicalEntry_t *xnewLogicalEntry);

Description

Allocates an entry in the Logical Table. The logidx parameter is the requested logical index. If logidx= 0, the function tries to use the first available index in the table. If logidx= 1 or greater, the function tries to use the specified index. If the specified index is in use, the function returns the first available index in the table. As a result, the returned index might not be the same as the requested logical index.

The allocLogicalEntry() function returns the logical index that is allocated to the entry. The memory that is associated with xnewLogicalEntry can be freed. The function creates a internal copy of the data.

The entLogicalEntry_t structure definition is shown in entLogicalEntry_t Structure. Special cases for xnewLogicalEntry values are handled as shown in the following table.

Object 

Value of xnewLogicalEntry

Entity MIB module handling 

entLogicalDescr

NULL 

reject 

entLogicalType

NULL 

{ 1,3,6,1,2,1 }

entLogicalCommunity

NULL 

""

entLogicalTAddress

NULL or ""

reject 

entLogicalTDomain

NULL 

reject 

entLogicalContextEngineId

NULL 

""

entLogicalContextName

NULL 

""

Returns

Returns the index allocated to the logical entry.

Returns -1 for error in adding the entry. Check the log for more details.

getLogicalTableEntry()

Synopsis

entLogicalEntry_t *getLogicalTableEntry(int xLogicalIndex);

Description

This function gets the logical table index structure for a particular index. The caller must not change the value or release the memory of the entry that is returned. The entLogicalEntry_t structure definition is shown in entLogicalEntry_t Structure.

Returns

Returns the entry that is associated with xLogicalIndex.

Returns NULL on error in finding the entry, or if a stale entry exists.

deleteLogicalTableEntry()

Synopsis

extern int deleteLogicalTableEntry(int xLogicalIndex);

Description

Deletes the logical table entry that is associated with the xLogicalIndex. The instances of xLogicalIndex in the entAliasMappingTable and the entLPMappingTable are also deleted to maintain integrity among the various Entity MIB tables.

Returns

0

for success.

-1

if the xLogicalIndex is not found.

-2

if a stale entry was found for xLogicalIndex.

makeLogicalTableEntryStale()

Synopsis

extern int makeLogicalTableEntryStale(int xLogicalIndex);

Description

Makes the logical table entry associated with the xLogicalIndex become stale. In this context, “stale” means that the entry details are present in the agent memory but are not displayed during any SNMP operation. The index that was allocated to a stale entry is not allocated to another entry.

When you make an entry become stale, the instances of xLogicalIndex in the entAliasMappingTable, entLPMappingTable and entPhysicalContainsTable are also deleted. The deletion maintains integrity among the various Entity MIB tables. Before you make an entry stale, you might want to store the entries that are to be deleted from the other tables.

The stale logical table entry can be made available again by calling the makeLogicalTableEntryLive() function, which is described in makeLogicalTableEntryLive().

Returns

0

for success.

-1

if the xLogicalIndex is not found.

–2

if a stale entry was found for xLogicalIndex.

makeLogicalTableEntryLive()

Synopsis

extern int makeLogicalTableEntryLive(int xLogicalIndex);

Description

Makes the stale logical table entry associated with the xLogicalIndex become live. In this context, “live” means that the entry details that are present in the agent memory are displayed during any SNMP operations. The entry can be made stale by calling the makeLogicalTableEntryStale() function.

If an entry is made live again, you must recreate the corresponding entries that were deleted in the entPhysicalContainsTable, the entLPMappingTable, and the entAliasMappingTable. Use the appropriate functions for adding an entry to each table: addPhysicalContainsTableEntry(), addLPMappingTableEntry(), and addAliasMappingTableEntry().

Returns

0

for success.

-1

if the xLogicalIndex is not found.

–2

if a live entry already exists for xLogicalIndex.

getLogicalStaleEntry()

Synopsis

entLogicalEntry_t *getLogicalStaleEntry(int index );

Description

Gets the stale logical table index structure for the specified index. The caller must not change the values or release the memory of the entry that is returned. The entLogicalEntry_t structure definition is shown in entLogicalEntry_t Structure.

Returns

Returns the stale entry for the specified index.

Returns NULL if the entry is not found, or if a live entry exists.