ext_session_acl.cc File Reference
#include "helper/protocol_defines.h"
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
Include dependency graph for ext_session_acl.cc:

Go to the source code of this file.

Macros

#define __BIT_TYPES_DEFINED__
 

Functions

static void shutdown_db ()
 
static void init_db (void)
 
static size_t dataSize (DB_ENTRY *data)
 
static bool fetchKey (DB_ENTRY &key, DB_ENTRY *data)
 
static void deleteEntry (DB_ENTRY &key)
 
static void copyValue (void *dst, const DB_ENTRY *src, size_t sz)
 
static int session_active (const char *details, size_t len)
 
static void session_login (char *details, size_t len)
 
static void session_logout (char *details, size_t len)
 
static void usage (void)
 
int main (int argc, char **argv)
 

Variables

static int session_ttl = 3600
 
static int fixed_timeout = 0
 
char * db_path = nullptr
 
const char * program_name
 
int session_is_active = 0
 

Macro Definition Documentation

◆ __BIT_TYPES_DEFINED__

#define __BIT_TYPES_DEFINED__

Definition at line 58 of file ext_session_acl.cc.

Function Documentation

◆ copyValue()

static void copyValue ( void *  dst,
const DB_ENTRY *  src,
size_t  sz 
)
static

Definition at line 188 of file ext_session_acl.cc.

Referenced by Snmp::Var::assign(), and session_active().

◆ dataSize()

static size_t dataSize ( DB_ENTRY *  data)
static

Definition at line 156 of file ext_session_acl.cc.

Referenced by session_active().

◆ deleteEntry()

static void deleteEntry ( DB_ENTRY &  key)
static

Definition at line 178 of file ext_session_acl.cc.

References db.

Referenced by session_active(), and session_logout().

◆ fetchKey()

static bool fetchKey ( DB_ENTRY &  key,
DB_ENTRY *  data 
)
static

Definition at line 166 of file ext_session_acl.cc.

References db.

Referenced by session_active().

◆ init_db()

static void init_db ( void  )
static

Definition at line 99 of file ext_session_acl.cc.

References db, db_path, program_name, shutdown_db(), and xstrdup.

Referenced by main().

◆ main()

◆ session_active()

static int session_active ( const char *  details,
size_t  len 
)
static

Definition at line 197 of file ext_session_acl.cc.

References copyValue(), dataSize(), deleteEntry(), fetchKey(), program_name, and session_ttl.

Referenced by main().

◆ session_login()

static void session_login ( char *  details,
size_t  len 
)
static

Definition at line 229 of file ext_session_acl.cc.

References db, and now.

Referenced by main().

◆ session_logout()

static void session_logout ( char *  details,
size_t  len 
)
static

Definition at line 250 of file ext_session_acl.cc.

References deleteEntry().

Referenced by main().

◆ shutdown_db()

static void shutdown_db ( void  )
static

Definition at line 80 of file ext_session_acl.cc.

References db, db_path, program_name, and xfree.

Referenced by init_db(), and main().

◆ usage()

static void usage ( void  )
static

Definition at line 263 of file ext_session_acl.cc.

References program_name.

Referenced by main().

Variable Documentation

◆ db_path

◆ fixed_timeout

int fixed_timeout = 0
static

Definition at line 62 of file ext_session_acl.cc.

Referenced by main().

◆ program_name

const char* program_name

Definition at line 64 of file ext_session_acl.cc.

Referenced by init_db(), main(), session_active(), shutdown_db(), and usage().

◆ session_is_active

int session_is_active = 0

Definition at line 153 of file ext_session_acl.cc.

◆ session_ttl

int session_ttl = 3600
static

Definition at line 61 of file ext_session_acl.cc.

Referenced by main(), and session_active().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors