Mixe for Privacy and Anonymity in the Internet
CADataRetentionLog.cpp
Go to the documentation of this file.
1 #include "StdAfx.h"
2 #ifdef DATA_RETENTION_LOG
3 #include "CADataRetentionLog.hpp"
4 
6  {
7  m_pLogFile=NULL;
9  m_strLogDir=NULL;
10  }
11 
13  {
14  closeLog();
15  delete[] m_strLogDir;
16  }
17 
19  {
20  m_pPublicEncryptionKey=pPublicKey;
21  return E_SUCCESS;
22  }
23 
25  {
26  UINT32 l=strlen((char*)strDir);
27  m_strLogDir=new UINT8[l+1];
28  memcpy(m_strLogDir,strDir,l);
29  m_strLogDir[l]=0;
30  m_max_t_out=0;
31  return E_SUCCESS;
32  }
33 
35  {
38  return E_UNKNOWN;
40  return E_SUCCESS;
41  }
42 
44  {
45  if(m_pLogFile!=NULL)
46  {
48  delete m_pLogFile;
49  m_pLogFile=NULL;
50  }
51  return E_SUCCESS;
52  }
53 
54 SINT32 CADataRetentionLog::log(t_dataretentionLogEntry* logEntry)
55  {
56  if(ntohl(logEntry->t_out)>m_max_t_out)
57  {
58  if(m_pLogFile!=NULL)
59  {
61  delete m_pLogFile;
62  m_pLogFile=NULL;
63  }
64  if(openLogFile(ntohl(logEntry->t_out))!=E_SUCCESS)
65  return E_UNKNOWN;
66  }
67  return m_pLogFile->log(logEntry);
68  }
69 #endif //DATA_RETENTION_LOG
signed int SINT32
Definition: basetypedefs.h:132
unsigned char UINT8
Definition: basetypedefs.h:135
unsigned int UINT32
Definition: basetypedefs.h:131
SINT32 log(t_dataretentionLogEntry *)
SINT32 openLog(UINT8 *strLogDir, UINT32 date, CAASymCipher *pPublicKey)
SINT32 setLogDir(UINT8 *strLogDir)
SINT32 log(t_dataretentionLogEntry *)
CAASymCipher * m_pPublicEncryptionKey
SINT32 openLogFile(UINT32 time)
CADataRetentionLogFile * m_pLogFile
SINT32 setPublicEncryptionKey(CAASymCipher *pPublicKey)
const SINT32 E_SUCCESS
Definition: errorcodes.hpp:2
#define E_UNKNOWN
Definition: errorcodes.hpp:3