Solaris System Management Agent Developer's Guide

Namespace Issues

This section explains the naming conventions for the System Management Agent. The conventions are required to enable all developers to avoid namespace collisions.

Avoiding Namespace Collisions

Namespace is a term used to indicate the complete set of possible names that can exist together in a certain “space.” Namespaces exist in the computer world and in the real world. For example, the names of people in a group, such as the passenger list in an aircraft, forms a namespace. In the computer world, a namespace might be a list of file names in a directory, or the function names in a source code file.

A namespace usually requires names to be unique, to ease the addressing of an individual entity. In the real world, the names of entities in a namespace might not always be unique. For example, there might be two aircraft passengers with the same name. In such situations, an attribute other than the name of the entities of the namespace must be used. For example, the seat numbers might form the namespace of the passengers on the aircraft.

The namespaces in the computing world mandate that uniqueness is ensured. For example, you must have unique names for all the files in a directory or functions that are part of the same program.

Namespace collision occurs if parts of the namespace delivered by different people have the same names. For example, two vendors might come up with the same library name and install in the same directory. A recent trend is to make the directory name part of the namespace, to ensure different directories for different vendors or different products. Even if the file names are the same, the file names are in different directories.

For the SMA developer, several areas are susceptible to namespace collisions. The following sections discuss naming conventions that you must follow to greatly reduce the possibility of having naming issues.

Module Names

The module name should be based closely on the name of the MIB that is implemented by the module. MIB name guidelines are discussed in MIB File Names.

Use the following guidelines to name your module, beginning with the name of the MIB file:

For example, if your MIB name is ACME-ROUTER-MIB.txt, you should name the module acmerouter. When you compile, the shared object that results is acmerouter.so.

Library Names

You must ensure unique names for your custom libraries because all libraries to be used with SMA are delivered into a single lib namespace. You should observe the following guidelines in naming your libraries:

For example, assume that your MIB name is ACME-ROUTER-MIB.txt. Your module name is acmerouter. The associated library should be named libacmerouter.so. The .so extension is added when you compile.