db2secGroupPluginInit API - Initialize group plug-in

Initialization API, for the group-retrieval plug-in, that the Db2® database manager calls immediately after loading the plug-in.

API and data structure syntax

SQL_API_RC SQL_API_FN db2secGroupPluginInit
                              ( db2int32 version,
                                void *group_fns,
                                db2secLogMessage *logMessage_fn,
                                char     **errormsg,
                                db2int32 *errormsglen );

db2secGroupPluginInit API parameters

version
Input. The highest version of the API supported by the instance loading that plugin. The value DB2SEC_API_VERSION (in db2secPlugin.h) contains the latest version number of the API that the Db2 database manager currently supports.
group_fns
Output. A pointer to the db2secGroupFunctions_<version_number> (also known as group_functions_<version_number>) structure. The db2secGroupFunctions_<version_number> structure contains pointers to the APIs implemented for the group-retrieval plug-in. In future, there might be different versions of the APIs (for example, db2secGroupFunctions_<version_number>), so the group_fns parameter is cast as a pointer to the db2secGroupFunctions_<version_number> structure corresponding to the version the plug-in has implemented. The first parameter of the group_functions_<version_number> structure tells Db2 the version of the APIs that the plug-in has implemented. Note: The casting is done only if the Db2 version is higher or equal to the version of the APIs that the plug-in has implemented. The version number represents the version of the APIs implemented by the plugin, and the pluginType should be set to DB2SEC_PLUGIN_TYPE_GROUP.
logMessage_fn
Input. A pointer to the db2secLogMessage API, which is implemented by the Db2 database system. The db2secGroupPluginInit API can call the db2secLogMessage API to log messages to the db2diag log files for debugging or informational purposes. The first parameter (level) of db2secLogMessage API specifies the type of diagnostic errors that will be recorded in the db2diag log files and the last two parameters are the message string and its length. The valid values for the first parameter of db2secLogMessage API (defined in db2secPlugin.h) are:
  • DB2SEC_LOG_NONE: (0) No logging
  • DB2SEC_LOG_CRITICAL: (1) Severe Error encountered
  • DB2SEC_LOG_ERROR: (2) Error encountered
  • DB2SEC_LOG_WARNING: (3) Warning
  • DB2SEC_LOG_INFO: (4) Informational
The message text shows up in the db2diag log files only if the value of the level parameter of the db2secLogMessage API is less than or equal to the diaglevel database manager configuration parameter. So for example, if you use the DB2SEC_LOG_INFO value, the message text shows up in the db2diag log files only if the diaglevel database manager configuration parameter is set to 4.
errormsg
Output. A pointer to the address of an ASCII error message string allocated by the plug-in that can be returned in this parameter if the db2secGroupPluginInit API execution is not successful.
errormsglen
Output. A pointer to an integer that indicates the length in bytes of the error message string in errormsg parameter.