Ejemplo de descarga de registros.
#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 "maestro"
#define USER_PWD "12345678"
int main()
{
int nRet = 0;
DWORD dwLogServerSize = 0;
if ( nRet!=0 ) {
printf ( "Error al inicializar la biblioteca Dinamo. Código %d\n", nRet );
ir a limpiar;
}
printf ("Biblioteca inicializada.\n");
strncpy(authPwd.
szAddr, HOST_ADDR,
sizeof(authPwd
.szAddr));
strncpy(authPwd.
szContraseña, USER_PWD,
sizeof(authPwd
.szContraseña));
if ( nRet!=0 ) {
printf ("Error al abrir sesión con Dinamo. Código %d\n", nRet);
ir a limpiar;
}
printf ( "Sesión abierta.\n" );
if ( nRet == 0 ) {
printf (
"Tamaño LOG en servidor sin formatear: "DWORD_PRINT" byte(s).\n", dwLogServerSize);
}
if ( dwLogServerSize>0 ) {
if ( cbLog ) {
}
}
limpia:
si ( hSesión )
{
printf ( "Sesión cerrada.\n" );
}
devolver nRet;
}
Interfaz de programación de aplicaciones (API) de HSM Dinamo.
void * HSESSIONCTX
Definición dinamo.h:68
#define PUERTO_DEFAULT
Definición dinamo.h:1948
#define DWORD_PRINT
Definición dinamo.h:55
#define CLEAR_CONN
dinamoDefinición.h:587
unsigned char BYTE
Definición dinamo.h:45
#define GET_LOG_START_FULL
dinamoDefinición.h:1522
#define LB_BYPASS
dinamoDefinición.h:588
unsigned int DWORD
Definición dinamo.h:46
#define SS_USER_PWD
dinamoDefinición.h:576
#define GET_LOG_END_FULL
dinamoDefinición.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 nPuerto
Definición dinamo.h:3091
char szUserId[MAX_USR_LEN]
Definición dinamo.h:3092
char szAddr[MAX_ADDR_LEN]
Definición dinamo.h:3090
char szContraseña[MAX_USR_PWD]
dinamoDefinición.h:3093