Example of downloading logs.
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#define HOST_ADDR "127.0.0.1"
#define USER_ID "master"
#define USER_PWD "12345678"
int main()
{
int nRet = 0;
DWORD dwLogServerSize = 0;
if ( nRet!=0 ) {
printf ( "Failed to initialize Dinamo library. Code %d\n", nRet );
goto clean;
}
printf ("Library initialized.\n");
strncpy(authPwd.
szAddr, HOST_ADDR,
sizeof(authPwd
.szAddr));
strncpy(authPwd.
szUserId, USER_ID,
sizeof(authPwd
.szUserId));
strncpy(authPwd.
szPassword, USER_PWD,
sizeof(authPwd
.szPassword));
if ( nRet!=0 ) {
printf ("Error opening session with Dinamo. Code %d\n", nRet);
goto clean;
}
printf ( "Session open.\n" );
if ( nRet == 0 ) {
printf (
"Size of LOG on server without formatting: "DWORD_PRINT" byte(s).\n", dwLogServerSize);
}
if ( dwLogServerSize>0 ) {
if ( cbLog ) {
}
}
clean:
if ( hSession )
{
printf ( "Session closed.\n" );
}
return nRet;
}
HSM Application Programming Interface (API) Dinamo.
void * HSESSIONCTX
Definition dinamo.h:68
#define DEFAULT_PORT
Definition dinamo.h:1948
#define DWORD_PRINT
Definition dinamo.h:55
#define CLEAR_CONN
Definition dinamo.h:587
unsigned char BYTE
Definition dinamo.h:45
#define GET_LOG_START_FULL
Definition dinamo.h:1522
#define LB_BYPASS
Definition dinamo.h:588
unsigned int DWORD
Definition dinamo.h:46
#define SS_USER_PWD
Definition dinamo.h:576
#define GET_LOG_END_FULL
Definition dinamo.h:1523
int AAP_API DGetStatLogSize(HSESSIONCTX hSession, DWORD *pdwLogLen)
int AAP_API DGetStatLog(HSESSIONCTX hSession, DWORD dwStart, DWORD dwOffset, DWORD *pdwLogSize, BYTE **ppbLog)
void *AAP_API DAlloc(DWORD dwsize)
void AAP_API DFree(void *p)
int AAP_API DOpenSession(HSESSIONCTX *phSession, DWORD dwParam, BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
int AAP_API DCloseSession(HSESSIONCTX *phSession, DWORD dwFlags)
int AAP_API DInitialize(DWORD dwReserved)
int nPort
Definition dinamo.h:3091
char szUserId[MAX_USR_LEN]
Definition dinamo.h:3092
char szAddr[MAX_ADDR_LEN]
Definition dinamo.h:3090
char szPassword[MAX_USR_PWD]
Definition dinamo.h:3093