252N/A#
252N/A# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
252N/A#
252N/A# U.S. Government Rights - Commercial software. Government users are subject
252N/A# to the Sun Microsystems, Inc. standard license agreement and applicable
252N/A# provisions of the FAR and its supplements.
252N/A#
252N/A#
252N/A# This distribution may include materials developed by third parties. Sun,
252N/A# Sun Microsystems, the Sun logo and Solaris are trademarks or registered
252N/A# trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
252N/A#
252N/A#
252N/A
252N/AList of Entity MIB APIs
252N/A-----------------------
252N/A
252N/APhysical Table (entPhysicalTable)
252N/A---------------------------------
252N/Aextern int allocPhysicalEntry(int physidx, entPhysicalEntry_t *newPhysEntry);
252N/A
252N/A - Allocates an entry in the Physical Table. The physidx parameter
252N/A is the physical index requested. If physidx = 0, it will try to use
252N/A the first available index in the table. If physidx > 0, then it will try
252N/A to use the slot indicated by the index.
252N/A
252N/A The API returns a physical index alloted to the entry, and this may or may
252N/A not be the same as the requested physical index.
252N/A
252N/A The memory associated with newPhysEntry can be freed. The API creates an
252N/A internal copy of the data.
252N/A
252N/A Returns:
252N/A - the index allocated to the physical entry
252N/A - -1 for error in adding the entry
252N/A
252N/A Check the log for more details.
252N/A
252N/A NOTE: The physidx (other than 0) is not used in this release of the API,
252N/A this is present for future purposes.
252N/A
252N/AentPhysicalEntry_t *getPhysicalTableEntry(int index);
252N/A
252N/A - This API returns the actual Physical Table entry for the
252N/A particular index. The caller must NOT change the values or release
252N/A the memory of the entry that is returned.
252N/A
252N/A Returns:
252N/A - the entry for that index
252N/A - NULL on error in finding the entry or if the entry is stale
252N/A
252N/Aextern int deletePhysicalTableEntry(int xPhysicalIndex);
252N/A
252N/A - Delete the Physical Table entry associated with the xPhysicalIndex. The
252N/A instances of xPhysicalIndex in the Alias Mapping Table, LP Mapping Table
252N/A and the Physical Contains Table will also be deleted to maintain
252N/A integrity among the various Entity MIB tables.
252N/A
252N/A Returns:
252N/A - 0 for success
252N/A - -1 if the xPhysicalIndex is not found
252N/A - -2 if a stale entry was found for xPhysicalIndex.
252N/A
252N/Aextern int makePhysicalTableEntryStale(int xPhysicalIndex);
252N/A
252N/A - Makes the Physical Table entry associated with the xPhysicalIndex stale.
252N/A Stale means that the entry details are present in the agent's memory but
252N/A it will not be displayed during any SNMP operation. The entry can be
252N/A made available again with the call to the makePhysicalTableEntryLive
252N/A API.
252N/A The index allocated to a stale entry will not be allocated to another
252N/A entry.
252N/A
252N/A The instances of xPhysicalIndex in the Alias Mapping Table, LP Mapping
252N/A Table and the Physical Contains Table will be deleted to maintain
252N/A integrity among the various Entity MIB tables.
252N/A
252N/A Returns:
252N/A - 0 for success
252N/A - -1 if the xPhysicalIndex is not found
252N/A - -2 if a stale entry already exists for xPhysicalIndex.
252N/A
252N/Aextern int makePhysicalTableEntryLive(int xPhysicalIndex);
252N/A
252N/A - Makes the stale Physical Table entry associated with the xPhysicalIndex
252N/A live.
252N/A Live means that the entry details that are present in the agent's memory
252N/A will be displayed during SNMP operations. The entry can be
252N/A made stale with the call to the makePhysicalTableEntryStale API.
252N/A
252N/A Returns:
252N/A - 0 for success
252N/A - -1 if the xPhysicalIndex is not found
252N/A - -2 if a live entry already exists for xPhysicalIndex.
252N/A
252N/AentPhysicalEntry_t *getPhysicalStaleEntry(int index);
252N/A
252N/A - This API returns the stale Physical Table entry for the
252N/A particular index. The caller must NOT change the values or release
252N/A the memory of the entry that is returned.
252N/A
252N/A Returns:
252N/A - the stale entry for that index
252N/A - NULL on error in finding the entry or if a live entry exists.
252N/A
252N/Aint *getAllChildrenFromPhysicalContainedIn(int parentIndex);
252N/A
252N/A - Get the indexes for all the children in the Physical Table which has
252N/A parentIndex as their parent (in the entPhysicalContainedIn field).
252N/A
252N/A Returns:
252N/A - returns an array of indexes (integers) with null termination
252N/A - NULL if no children, or invalid index, or not enough memory when
252N/A allocating the array
252N/A
252N/A NOTE: The array is a copy and SHOULD be freed when done
252N/A
252N/ALogical Table (entLogicalTable)
252N/A-------------------------------
252N/A
252N/Aextern int allocLogicalEntry(int logidx, entLogicalEntry_t * xnewLogicalEntry);
252N/A
252N/A - Allocates an entry in the Logical Table. The logidx parameter
252N/A is the logical index requested. If logidx = 0, it will try to use
252N/A the first available index in the table. If physidx > 0, then it will try
252N/A to use the slot indicated by the index.
252N/A
252N/A The API returns a logical index alloted to the entry, and this may or may
252N/A not be the same as the requested logical index.
252N/A
252N/A The memory associated with xnewLogicalEntry can be freed. The API creates
252N/A an internal copy of the data.
252N/A
252N/A Returns:
252N/A - the index allocated to the logical entry
252N/A - -1 for error in adding the entry
252N/A
252N/A Check the log for more details.
252N/A
252N/A NOTE: The logidx (other than 0) is not used in this release of the API,
252N/A this is present for future purposes.
252N/A
252N/A
252N/AentLogicalEntry_t* getLogicalTableEntry(int xLogicalIndex);
252N/A
252N/A - This API returns the actual Logical Table entry for the
252N/A particular index. The caller must NOT change the values or release
252N/A the memory of the entry that is returned.
252N/A
252N/A Returns:
252N/A - the entry for that index
252N/A - NULL on error in finding the entry or if a stale entry exists.
252N/A
252N/Aextern int deleteLogicalTableEntry(int xLogicalIndex);
252N/A
252N/A - Delete the Logical Table entry associated with the xLogicalIndex. The
252N/A instances of xLogicalIndex in the Alias Mapping Table, and the
252N/A LP Mapping Table will also be deleted to maintain integrity among the
252N/A various Entity MIB tables.
252N/A
252N/A Returns:
252N/A - 0 for success
252N/A - -1 if the xLogicalIndex is not found
252N/A - -2 if a stale entry was found for xLogicalIndex.
252N/A
252N/Aextern int makeLogicalTableEntryStale(int xLogicalIndex);
252N/A
252N/A - Makes the Logical Table entry associated with the xLogicalIndex stale.
252N/A Stale means that the entry details are present in the agent's memory but
252N/A it will not be displayed during any SNMP operation. The entry can be
252N/A made available again with the call to the makeLogicalTableEntryLive API.
252N/A The index allocated to a stale entry will not be allocated to another
252N/A entry.
252N/A
252N/A The instances of xLogicalIndex in the Alias Mapping Table, and the
252N/A LP Mapping Table will be deleted to maintain integrity among the various
252N/A Entity MIB tables.
252N/A
252N/A Returns:
252N/A - 0 for success
252N/A - -1 if the xPhysicalIndex is not found
252N/A - -2 if a stale entry already exists for xPhysicalIndex.
252N/A
252N/Aextern int makeLogicalTableEntryLive(int xLogicalIndex);
252N/A
252N/A - Makes the stale Logical Table entry associated with the xLogicalIndex
252N/A live.
252N/A Live means that the entry details that are present in the agent's memory
252N/A will be displayed during SNMP operations. The entry can be
252N/A made stale with the call to the makeLogicalTableEntryStale API.
252N/A
252N/A Returns:
252N/A - 0 for success
252N/A - -1 if the xLogicalIndex is not found
252N/A - -2 if a live entry already exists for xLogicalIndex.
252N/A
252N/AentLogicalEntry_t *getLogicalStaleEntry(int index);
252N/A
252N/A - This API returns the stale Logical Table entry for the
252N/A particular index. The caller must NOT change the values or release
252N/A the memory of the entry that is returned.
252N/A
252N/A Returns:
252N/A - the stale entry for that index
252N/A - NULL on error in finding the entry or if a live entry exists.
252N/A
252N/ALP Mapping Table (entLPMappingTable)
252N/A------------------------------------
252N/Aextern int addLPMappingTableEntry(int xentLogicalIndex, int xentPhysicalIndex);
252N/A
252N/A - Adds an entry to the LP Mapping Table with the xentLogicalIndex as the
252N/A primary index and xentPhysicalIndex as the secondary index.
252N/A
252N/A Returns:
252N/A - 0 for successful addition
252N/A - 1 if the entry for the given xentPhysicalIndex and
252N/A xentLogicalIndex already exists.
252N/A - -1 for failure
252N/A
252N/Aextern int deleteLPMappingTableEntry(int xLogicalIndex, int xPhysicalIndex);
252N/A
252N/A - Deletes the entry of the LP Mapping Table with the xLogicalIndex as
252N/A the primary index and xPhysicalIndex as the secondary index.
252N/A
252N/A Returns:
252N/A - 0 for successful deletion
252N/A - -1 for failure
252N/A - -2 for stale entry (either logical or physical index, or both)
252N/A
252N/Aextern int deleteLPMappingLogicalIndex(int xentLogicalIndex);
252N/A
252N/A - Deletes all the entries of the LP Mapping Table with the xentLogicalIndex
252N/A as the primary index.
252N/A
252N/A Returns:
252N/A - number of deleted entries for successful deletion
252N/A - -1 for failure
252N/A - -2 for stale logical entry
252N/A
252N/Aextern int deleteLPMappingPhysicalIndex(int xentPhysicalIndex);
252N/A
252N/A - Deletes all the entries of the LP Mapping Table with the xentPhysicalIndex
252N/A as the secondary index.
252N/A
252N/A Returns:
252N/A - number of deleted entries for successful deletion
252N/A - -1 if no entry was deleted.
252N/A - -2 for stale physical entry
252N/A
252N/AAlias Mapping Table (entAliasMappingTable)
252N/A------------------------------------------
252N/Aextern int addAliasMappingTableEntry(int xentPhysicalIndex, int xentLogicalIndex, oid* xAliasMapId, int xAliasMapIdSize);
252N/A
252N/A - Adds an entry to the Alias Mapping Table with xentPhysicalIndex as
252N/A the primary index and xentLogicalIndex as the secondary index.
252N/A xAliasMapId is the alias (OID) for the entry and xAliasMapIdSize is a size
252N/A in bytes of xAliasMapId
252N/A
252N/A Returns:
252N/A - 0 for successful addition
252N/A - 1 if the entry already exists for the given xentPhysicalIndex and
252N/A xentLogicalIndex already exists.
252N/A - -1 for failure
252N/A
252N/Aextern int deleteAliasMappingTableEntry(int xentPhysicalIndex, int xentLogicalIndex);
252N/A
252N/A - Deletes the entry of the Alias Mapping Table with xentPhysicalIndex as
252N/A the primary index and xentLogicalIndex as the secondary index.
252N/A
252N/A Returns:
252N/A - 0 for successful deletion
252N/A - -1 for entry not found
252N/A - -2 for stale entry
252N/A
252N/Aextern int deleteAliasMappingLogicalIndex(int xentLogicalIndex);
252N/A
252N/A - Deletes all the entries of the Alias Mapping Table with the
252N/A xentLogicalIndex as the secondary index
252N/A
252N/A Returns:
252N/A - number of deleted entries for successful deletion
252N/A - -1 for entry not found
252N/A - -2 for stale logical entry
252N/A
252N/A NOTE: This API cannot be used to delete all indexes with
252N/A xentLogicalIndex = 0. Use the deleteAliasMappingTableEntry API
252N/A to delete such entries one by one, with the appropriate
252N/A entPhysicalIndex specified.
252N/A
252N/Aextern int deleteAliasMappingPhysicalIndex(int xentPhysicalIndex);
252N/A
252N/A - Deletes all the entries in the Alias Mapping Table with the
252N/A primary index same as the given physical index
252N/A
252N/A Returns:
252N/A - number of deleted entries for on success
252N/A - -1 for entry not found
252N/A - -2 for stale physical entry
252N/A
252N/APhysical Contains Table (entPhysicalContainsTable)
252N/A--------------------------------------------------
252N/Aextern int addPhysicalContainsTableEntry(int entPhysicalIndex, int childIndex);
252N/A
252N/A - Adds an entry to the Physical Contains Table for the given entPhysicalIndex
252N/A and childIndex. The entPhysicalContainedIn OID present in the Physical
252N/A Table for the childIndex will be replaced by the entPhysicalIndex if the
252N/A entPhysicalIndex has a lower index than the original one
252N/A
252N/A Returns:
252N/A - 0 for successful addition
252N/A - 1 if the entry already exists for the given entPhysicalIndex and
252N/A childIndex.
252N/A - -1 for failure to add.
252N/A
252N/A
252N/Aextern int deletePhysicalContainsTableEntry(int parentIndex, int childIndex);
252N/A
252N/A - Deletes the parentIndex/childIndex entry present in the Physical Contains
252N/A Table.
252N/A
252N/A Returns:
252N/A - 0 for success
252N/A - -1 for failure
252N/A - -2 for stale entry (either parent or child, or both)
252N/A
252N/Aextern int deletePhysicalContainsParentIndex(int parentIndex);
252N/A
252N/A - Deletes all the entries in the Physical Contains Table where the parent
252N/A index = parentIndex.
252N/A
252N/A Returns:
252N/A - number of children deleted for that parent
252N/A - -1 for failure
252N/A - -2 for stale parent entry
252N/A
252N/Aextern int deletePhysicalContainsChildIndex(int childIndex);
252N/A
252N/A - Deletes all the entries in the Physical Contains Table where the child
252N/A index = childIndex.
252N/A
252N/A Returns:
252N/A - number of parents deleted for that child
252N/A - -1 for failure
252N/A - -2 for stale child entry
252N/A
252N/Aextern int* getPhysicalContainsChildren(int parentIndex);
252N/A
252N/A - Get the indexes for all the children in the Physical Contains
252N/A Table, given a parent.
252N/A
252N/A Returns:
252N/A - returns an array of indexes (integers) with null termination
252N/A - NULL if no children, or not enough memory when allocating the array
252N/A
252N/A NOTE: The array is a copy and SHOULD be freed when done
252N/A
252N/AData Structures
252N/A---------------
252N/AThe corresponding header files will be public interfaces as well, because the
252N/Adata structures are defined there.
252N/A
252N/Atypedef struct entPhysicalEntry_s {
252N/A int entPhysicalIndex;
252N/A char *entPhysicalDescr;
252N/A oid *entPhysicalVendorType;
252N/A int entPhysicalVendorTypeSize;
252N/A int entPhysicalContainedIn;
252N/A int entPhysicalClass; /* see ENTPHYSICAL_CLASS_XXX */
252N/A int entPhysicalParentRelPos;
252N/A char *entPhysicalName;
252N/A char *entPhysicalHardwareRev;
252N/A char *entPhysicalFirmwareRev;
252N/A char *entPhysicalSoftwareRev;
252N/A char *entPhysicalSerialNum;
252N/A char *entPhysicalMfgName;
252N/A char *entPhysicalModelName;
252N/A char *entPhysicalAlias;
252N/A char *entPhysicalAssetID;
252N/A int entPhysicalIsFRU;
252N/A struct entPhysicalEntry_s *pNextEntry;
252N/A} entPhysicalEntry_t;
252N/A
252N/Atypedef struct entLogicalEntry_s {
252N/A int entLogicalIndex;
252N/A char *entLogicalDescr;
252N/A oid *entLogicalType;
252N/A int entLogicalTypeSize;
252N/A char *entLogicalCommunity;
252N/A char *entLogicalTAddress;
252N/A oid *entLogicalTDomain;
252N/A int entLogicalTDomainSize;
252N/A char *entLogicalContextEngineId;
252N/A char *entLogicalContextName;
252N/A struct entLogicalEntry_s* pNextEntry;
252N/A} entLogicalEntry_t;