Added the capability to modify the DebugLevel by changing the various .conf files.
This commit is contained in:
		| @@ -86,3 +86,18 @@ AllowInvalidCerts	true | |||||||
| #              THIS FUNCTIONALITY HAS NOT BEEN IMPLEMENTED | #              THIS FUNCTIONALITY HAS NOT BEEN IMPLEMENTED | ||||||
| # | # | ||||||
| #UsersCannotAllowInvalidCerts	true | #UsersCannotAllowInvalidCerts	true | ||||||
|  |  | ||||||
|  | # | ||||||
|  | # DebugLevel setting. | ||||||
|  | # | ||||||
|  | # Description: Used to specify the level of logging utilized for debugging | ||||||
|  | #              purposes. A level of zero being the lowest debugging level. | ||||||
|  | # | ||||||
|  | #              If this parameter is not set, the client defaults | ||||||
|  | #              to use a debug level of zero. | ||||||
|  | # | ||||||
|  | #              Note: Debug statements can be viewed under Windows by using | ||||||
|  | #              tools such as DbgView. Under Linux, debug statements are logged | ||||||
|  | #              to /var/log/messages. | ||||||
|  | # | ||||||
|  | #DebugLevel	0 | ||||||
|   | |||||||
| @@ -737,6 +737,7 @@ InitializeLibrary(void) | |||||||
|    int         retStatus = -1; |    int         retStatus = -1; | ||||||
|    int         getConfigStatus = -1; |    int         getConfigStatus = -1; | ||||||
|    ConfigIf    *pClientConfigIf; |    ConfigIf    *pClientConfigIf; | ||||||
|  |    char        *pDebugLevelSetting; | ||||||
|    char        *pATSPortSetting; |    char        *pATSPortSetting; | ||||||
|    char        *pDisableSecureConnections; |    char        *pDisableSecureConnections; | ||||||
|    char        *pAllowInvalidCerts; |    char        *pAllowInvalidCerts; | ||||||
| @@ -751,6 +752,19 @@ InitializeLibrary(void) | |||||||
|    if (CASA_SUCCESS(getConfigStatus) |    if (CASA_SUCCESS(getConfigStatus) | ||||||
|        && CasaStatusCode(getConfigStatus) != CASA_STATUS_OBJECT_NOT_FOUND) |        && CasaStatusCode(getConfigStatus) != CASA_STATUS_OBJECT_NOT_FOUND) | ||||||
|    { |    { | ||||||
|  |       // Check if a DebugLevel has been configured | ||||||
|  |       pDebugLevelSetting = pClientConfigIf->getEntryValue(pClientConfigIf, "DebugLevel"); | ||||||
|  |       if (pDebugLevelSetting != NULL) | ||||||
|  |       { | ||||||
|  |          DbgTrace(0, "-InitializeLibrary- DebugLevel configured = %s\n", pDebugLevelSetting); | ||||||
|  |           | ||||||
|  |          // Convert the number to hex | ||||||
|  |          DebugLevel = (int) dtoul(pDebugLevelSetting, strlen(pDebugLevelSetting)); | ||||||
|  |  | ||||||
|  |          // Free the buffer holding the debug level | ||||||
|  |          free(pDebugLevelSetting); | ||||||
|  |       } | ||||||
|  |  | ||||||
|       // Check if an ATS hostname has been configured |       // Check if an ATS hostname has been configured | ||||||
|       g_pATSHostName = pClientConfigIf->getEntryValue(pClientConfigIf, "ATS-hostname"); |       g_pATSHostName = pClientConfigIf->getEntryValue(pClientConfigIf, "ATS-hostname"); | ||||||
|       if (g_pATSHostName != NULL) |       if (g_pATSHostName != NULL) | ||||||
|   | |||||||
| @@ -149,7 +149,7 @@ GET_AUTH_TOKEN_INTERFACE_RTN( | |||||||
| { | { | ||||||
|    CasaStatus           retStatus; |    CasaStatus           retStatus; | ||||||
|    AuthTokenIfInstance  *pAuthTokenIfInstance; |    AuthTokenIfInstance  *pAuthTokenIfInstance; | ||||||
|  |    char                 *pDebugLevelSetting; | ||||||
|  |  | ||||||
|    DbgTrace(1, "-GetAuthTokenInterface- Start\n", 0); |    DbgTrace(1, "-GetAuthTokenInterface- Start\n", 0); | ||||||
|  |  | ||||||
| @@ -165,6 +165,19 @@ GET_AUTH_TOKEN_INTERFACE_RTN( | |||||||
|       goto exit; |       goto exit; | ||||||
|    } |    } | ||||||
|  |  | ||||||
|  |    // Check if a DebugLevel has been configured | ||||||
|  |    pDebugLevelSetting = pModuleConfigIf->getEntryValue(pModuleConfigIf, "DebugLevel"); | ||||||
|  |    if (pDebugLevelSetting != NULL) | ||||||
|  |    { | ||||||
|  |       DbgTrace(0, "-GetAuthTokenInterface- DebugLevel configured = %s\n", pDebugLevelSetting); | ||||||
|  |        | ||||||
|  |       // Convert the number to hex | ||||||
|  |       DebugLevel = (int) dtoul(pDebugLevelSetting, strlen(pDebugLevelSetting)); | ||||||
|  |  | ||||||
|  |       // Free the buffer holding the debug level | ||||||
|  |       free(pDebugLevelSetting); | ||||||
|  |    } | ||||||
|  |  | ||||||
|    // Allocate space for the interface instance |    // Allocate space for the interface instance | ||||||
|    pAuthTokenIfInstance = malloc(sizeof(*pAuthTokenIfInstance)); |    pAuthTokenIfInstance = malloc(sizeof(*pAuthTokenIfInstance)); | ||||||
|    if (pAuthTokenIfInstance) |    if (pAuthTokenIfInstance) | ||||||
|   | |||||||
| @@ -86,6 +86,11 @@ DecodeData( | |||||||
|    INOUT void **ppData, |    INOUT void **ppData, | ||||||
|    INOUT int32_t *pDataLen); |    INOUT int32_t *pDataLen); | ||||||
|  |  | ||||||
|  | extern | ||||||
|  | int | ||||||
|  | dtoul( | ||||||
|  |    IN    const char *cp, | ||||||
|  |    IN    const int len); | ||||||
|  |  | ||||||
| //========================================================================= | //========================================================================= | ||||||
|  |  | ||||||
|   | |||||||
| @@ -276,6 +276,48 @@ DecodeData( | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | //++======================================================================= | ||||||
|  | int | ||||||
|  | dtoul( | ||||||
|  |    IN    const char *cp, | ||||||
|  |    IN    const int len) | ||||||
|  | // | ||||||
|  | //  Arguments:  | ||||||
|  | // | ||||||
|  | //  Returns:    | ||||||
|  | // | ||||||
|  | //  Abstract:   | ||||||
|  | // | ||||||
|  | //  Notes: | ||||||
|  | // | ||||||
|  | // L2 | ||||||
|  | //=======================================================================-- | ||||||
|  | { | ||||||
|  |    int   n = 0; | ||||||
|  |    int   i; | ||||||
|  |  | ||||||
|  |    DbgTrace(2, "-dtoul- Start\n", 0); | ||||||
|  |  | ||||||
|  |    for (i = 0; i < len; i++, cp++) | ||||||
|  |    { | ||||||
|  |       // Verify that we are dealing with a valid digit | ||||||
|  |       if (*cp >= '0' && *cp <= '9') | ||||||
|  |       { | ||||||
|  |          n = 10 * n + (*cp - '0'); | ||||||
|  |       } | ||||||
|  |       else | ||||||
|  |       { | ||||||
|  |          DbgTrace(0, "-dtoul- Found invalid digit\n", 0); | ||||||
|  |          break; | ||||||
|  |       } | ||||||
|  |    } | ||||||
|  |        | ||||||
|  |    DbgTrace(2, "-dtoul- End, result = %d\n", n); | ||||||
|  |  | ||||||
|  |    return n; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| //++======================================================================= | //++======================================================================= | ||||||
| //++======================================================================= | //++======================================================================= | ||||||
| //++======================================================================= | //++======================================================================= | ||||||
|   | |||||||
| @@ -9,4 +9,19 @@ | |||||||
|  |  | ||||||
| LibraryName		\Program Files\novell\casa\lib\krb5mech.dll | LibraryName		\Program Files\novell\casa\lib\krb5mech.dll | ||||||
|  |  | ||||||
|  | # | ||||||
|  | # DebugLevel setting. | ||||||
|  | # | ||||||
|  | # Description: Used to specify the level of logging utilized for debugging | ||||||
|  | #              purposes. A level of zero being the lowest debugging level. | ||||||
|  | # | ||||||
|  | #              If this parameter is not set, the client defaults | ||||||
|  | #              to use a debug level of zero. | ||||||
|  | # | ||||||
|  | #              Note: Debug statements can be viewed under Windows by using | ||||||
|  | #              tools such as DbgView. Under Linux, debug statements are logged | ||||||
|  | #              to /var/log/messages. | ||||||
|  | # | ||||||
|  | #DebugLevel	0 | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -149,7 +149,7 @@ GET_AUTH_TOKEN_INTERFACE_RTN( | |||||||
| { | { | ||||||
|    CasaStatus           retStatus; |    CasaStatus           retStatus; | ||||||
|    AuthTokenIfInstance  *pAuthTokenIfInstance; |    AuthTokenIfInstance  *pAuthTokenIfInstance; | ||||||
|  |    char                 *pDebugLevelSetting; | ||||||
|  |  | ||||||
|    DbgTrace(1, "-GetAuthTokenInterface- Start\n", 0); |    DbgTrace(1, "-GetAuthTokenInterface- Start\n", 0); | ||||||
|  |  | ||||||
| @@ -165,6 +165,19 @@ GET_AUTH_TOKEN_INTERFACE_RTN( | |||||||
|       goto exit; |       goto exit; | ||||||
|    } |    } | ||||||
|  |  | ||||||
|  |    // Check if a DebugLevel has been configured | ||||||
|  |    pDebugLevelSetting = pModuleConfigIf->getEntryValue(pModuleConfigIf, "DebugLevel"); | ||||||
|  |    if (pDebugLevelSetting != NULL) | ||||||
|  |    { | ||||||
|  |       DbgTrace(0, "-GetAuthTokenInterface- DebugLevel configured = %s\n", pDebugLevelSetting); | ||||||
|  |        | ||||||
|  |       // Convert the number to hex | ||||||
|  |       DebugLevel = (int) dtoul(pDebugLevelSetting, strlen(pDebugLevelSetting)); | ||||||
|  |  | ||||||
|  |       // Free the buffer holding the debug level | ||||||
|  |       free(pDebugLevelSetting); | ||||||
|  |    } | ||||||
|  |  | ||||||
|    // Allocate space for the interface instance |    // Allocate space for the interface instance | ||||||
|    pAuthTokenIfInstance = malloc(sizeof(*pAuthTokenIfInstance)); |    pAuthTokenIfInstance = malloc(sizeof(*pAuthTokenIfInstance)); | ||||||
|    if (pAuthTokenIfInstance) |    if (pAuthTokenIfInstance) | ||||||
|   | |||||||
| @@ -84,6 +84,12 @@ DecodeData( | |||||||
|    INOUT void **ppData, |    INOUT void **ppData, | ||||||
|    INOUT int32_t *pDataLen); |    INOUT int32_t *pDataLen); | ||||||
|  |  | ||||||
|  | extern | ||||||
|  | int | ||||||
|  | dtoul( | ||||||
|  |    IN    const char *cp, | ||||||
|  |    IN    const int len); | ||||||
|  |  | ||||||
| //========================================================================= | //========================================================================= | ||||||
|  |  | ||||||
| #endif // _INTERNAL_H_ | #endif // _INTERNAL_H_ | ||||||
|   | |||||||
| @@ -276,6 +276,48 @@ DecodeData( | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | //++======================================================================= | ||||||
|  | int | ||||||
|  | dtoul( | ||||||
|  |    IN    const char *cp, | ||||||
|  |    IN    const int len) | ||||||
|  | // | ||||||
|  | //  Arguments:  | ||||||
|  | // | ||||||
|  | //  Returns:    | ||||||
|  | // | ||||||
|  | //  Abstract:   | ||||||
|  | // | ||||||
|  | //  Notes: | ||||||
|  | // | ||||||
|  | // L2 | ||||||
|  | //=======================================================================-- | ||||||
|  | { | ||||||
|  |    int   n = 0; | ||||||
|  |    int   i; | ||||||
|  |  | ||||||
|  |    DbgTrace(2, "-dtoul- Start\n", 0); | ||||||
|  |  | ||||||
|  |    for (i = 0; i < len; i++, cp++) | ||||||
|  |    { | ||||||
|  |       // Verify that we are dealing with a valid digit | ||||||
|  |       if (*cp >= '0' && *cp <= '9') | ||||||
|  |       { | ||||||
|  |          n = 10 * n + (*cp - '0'); | ||||||
|  |       } | ||||||
|  |       else | ||||||
|  |       { | ||||||
|  |          DbgTrace(0, "-dtoul- Found invalid digit\n", 0); | ||||||
|  |          break; | ||||||
|  |       } | ||||||
|  |    } | ||||||
|  |        | ||||||
|  |    DbgTrace(2, "-dtoul- End, result = %d\n", n); | ||||||
|  |  | ||||||
|  |    return n; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| //++======================================================================= | //++======================================================================= | ||||||
| //++======================================================================= | //++======================================================================= | ||||||
| //++======================================================================= | //++======================================================================= | ||||||
|   | |||||||
| @@ -9,4 +9,18 @@ | |||||||
|  |  | ||||||
| LibraryName		\Program Files\novell\casa\lib\pwmech.dll | LibraryName		\Program Files\novell\casa\lib\pwmech.dll | ||||||
|  |  | ||||||
|  | # | ||||||
|  | # DebugLevel setting. | ||||||
|  | # | ||||||
|  | # Description: Used to specify the level of logging utilized for debugging | ||||||
|  | #              purposes. A level of zero being the lowest debugging level. | ||||||
|  | # | ||||||
|  | #              If this parameter is not set, the client defaults | ||||||
|  | #              to use a debug level of zero. | ||||||
|  | # | ||||||
|  | #              Note: Debug statements can be viewed under Windows by using | ||||||
|  | #              tools such as DbgView. Under Linux, debug statements are logged | ||||||
|  | #              to /var/log/messages. | ||||||
|  | # | ||||||
|  | #DebugLevel	0 | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user