INTERNALAUTHENTICATECALLBACK

#include "ltdic.h"

L_UINT32 pEXT_CALLBACK Your_Function(hNet, nChallenge, nResponse, nParameter, pUserData)

Generates a response code, based on the specified challenge code. This function is available in PACS Imaging.

Parameters

HDICOMNET hNet

Handle to an existing DICOM Network. This is the handle returned from the L_DicomCreateNet function.

L_UINT64 nChallenge

Challenge code received by the callback function. This challenge code will be used in the generation of the response code. This value is similar to a time stamp.

L_UINT64 *nResponse

Pointer to a variable to be updated with the response code generated by the callback function.

L_UINT64 nParameter

Value that indicates the current mutual authentication key.

L_VOID * pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs. To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

Value Meaning
DICOM_SUCCESS The generation of the response code was successful.
<> DICOM_SUCCESS The generation of the response code was not successful.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

L_UINT64 * nResponse; 
 
L_UINT64 GetRandom() 
{ 
   L_UINT64 nRet; 
   nRet = ((L_UINT64)(rand())<<48) + ((L_UINT64)(rand())<<32) + (rand()<<16) + (rand()<<8) + rand(); 
   return nRet; 
} 
 
// Definitions of the ISCL callbacks. 
L_UINT32 EXT_CALLBACK exGetChallengeISCL(HDICOMNET hNet, L_UINT64 *nChallenge, L_UINT64 nParameter, L_VOID * pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
   UNREFERENCED_PARAMETER(hNet); 
    
 
   nResponse = nChallenge + nParameter; 
   return 0; 
} 
 
L_UINT32 EXT_CALLBACK exInternalAuthenticateISCL (HDICOMNET hNet, L_UINT64 nChallenge, L_UINT64 *nResponse, L_UINT64 nParameter, L_VOID * pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
   UNREFERENCED_PARAMETER(hNet); 
 
   *nResponse = nChallenge + nParameter; 
   return 0; 
} 
 
L_UINT32 EXT_CALLBACK exExternalAuthenticateISCL (HDICOMNET hNet, L_UINT64 nChallenge, L_UINT64 nResponse, L_UINT64 nParameter, L_VOID * pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
   UNREFERENCED_PARAMETER(hNet); 
 
   if (nResponse == nChallenge + nParameter) 
      return 0; 
   else 
      return 1; 
} 
 
L_INT InternalAuthenticateCBExample(HDICOMNET hNet) 
{ 
   DICOMNETCALLBACK cb; 
   //… 
   //… 
   cb.pfnGetChallenge = exGetChallengeISCL; 
   cb.pfnInternalAuthenticate = exInternalAuthenticateISCL; 
   cb.pfnExternalAuthenticate = exExternalAuthenticateISCL; 
 
   L_DicomSetCallback (hNet, &cb); 
 
   return DICOM_SUCCESS; 
 
} 
Help Version 20.0.2019.9.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help