
Configuration Manager
4-3
Initialization and Configuration
4.2
Configuration Manager
4.2.1
Synopsis
The configuration manager is a collection of API functions that allow a user to
create and manipulate a configuration. The manager API is independent of the
configuration specification.
The configuration is arranged as a database with a master key (called Tag)
which defines the class of configuration item. A second key (called Item) deter-
mines the sub-item type in the tag class. For each tag and item, there can be
multiple instances. Items can be further distinguished by their instance value.
The configuration is based on an active database. That is, any change to the
database can cause an immediate reaction in the system. For example, if a
route is added to the configuration, it is added to the system route table. If the
route is then removed from the configuration, it is removed from the system
route table.
In order to facilitate the active procession of configuration changes in a generic
fashion, the configuration API allows a programmer to install service provider
callback functions that are called to handle specific tag values in the configura-
tion.
Configurations can be set active or inactive. When a configuration is active,
any change to the configuration results in a change in the system. When a con-
figuration is inactive, it behaves like a standard database. Part of the main init-
ialization sequence is the make the system configuration active, and then inac-
tive when shutting down.
Both the configurations and configuration entries are referenced by a generic
handle. Configuration functions (named as CfgXxx()) take a configuration han-
dle parameter, while configuration entry functions (name as CfgEntryXxx())
take a configuration entry handle parameter. These handles are not inter-
changeable.
Configuration entry handles are referenced. This means that each handle con-
tains an internal reference count. This is used so that the handle is not de-
stroyed by one task while another task expects it to stay valid. Functions that
return a configuration entry handle supply a “referenced” handle in that its ref-
erence count had already been incremented for the caller. The caller can hold
this handle indefinitely, but should dereference it when it is through. There are
three calls that dereference a configuration entry handle. These are: CfgRe-
moveEntry(), CfgGetNextEntry(), and most simply CfgEntryDeRef(). See indi-
vidual function descriptions for more information.