clsync
Loading...
Searching...
No Matches
mon_bsm.c File Reference
#include "common.h"
#include "malloc.h"
#include "error.h"
#include "indexes.h"
#include "sync.h"
#include "mon_bsm.h"
#include <bsm/libbsm.h>
#include <bsm/audit_kevents.h>
#include <glib.h>
#include <sys/ioctl.h>
#include <security/audit/audit_ioctl.h>
Include dependency graph for mon_bsm.c:

Go to the source code of this file.

Data Structures

struct  bsm_event
 
struct  mondata
 
struct  recognize_event_return
 

Macros

#define BSM_INIT_ERROR
 
#define INFINITETIME   (3600 * 24 * 365 * 10) /* ~10 years */
 

Typedefs

typedef struct mondata mondata_t
 
typedef enum bsm_handletype bsm_handletype_t
 

Enumerations

enum  event_bits { UEM_DIR = 0x01 , UEM_CREATED = 0x02 , UEM_DELETED = 0x04 }
 
enum  bsm_handle_type { BSM_HANDLER_CALLWAIT , BSM_HANDLER_ITERATE }
 
enum  bsm_handletype { BSM_HANDLE_CALLWAIT , BSM_HANDLE_ITERATE }
 

Functions

int bsm_prefetcher (struct ctx *ctx_p)
 
int bsm_wait_prefetched (struct ctx *ctx_p, struct indexes *indexes_p, struct timeval *timeout_p)
 
int bsm_wait_noprefetch (struct ctx *ctx_p, struct indexes *indexes_p, struct timeval *timeout_p)
 
int bsm_handle_prefetched (struct ctx *ctx_p, struct indexes *indexes_p)
 
int bsm_handle_noprefetch (struct ctx *ctx_p, struct indexes *indexes_p)
 
static void recognize_event (struct recognize_event_return *r, uint32_t event)
 
int auditd_restart ()
 
int bsm_config_backup (mondata_t *mondata)
 
int bsm_config_setup (mondata_t *mondata)
 
int bsm_init (ctx_t *ctx_p)
 
int select_rfd (int fd, struct timeval *timeout_p)
 
int bsm_fetch (ctx_t *ctx_p, indexes_t *indexes_p, struct bsm_event *event_p, int pipe_fd, struct timeval *timeout_p, struct timeval *timeout_abs_p)
 
int bsm_handle_allevents (struct ctx *ctx_p, struct indexes *indexes_p, bsm_handletype_t how)
 
void bsm_prefetcher_sig_int (int signal)
 
int bsm_add_watch_dir (struct ctx *ctx_p, struct indexes *indexes_p, const char *const accpath)
 
int bsm_deinit (ctx_t *ctx_p)
 

Variables

pthread_t prefetcher_thread
 
pthread_mutex_t bsm_mutex_prefetcher = PTHREAD_MUTEX_INITIALIZER
 
pthread_cond_t bsm_cond_gotevent = PTHREAD_COND_INITIALIZER
 
pthread_cond_t bsm_cond_queueend = PTHREAD_COND_INITIALIZER
 
int bsm_queue_len
 
int(* bsm_wait )(struct ctx *ctx_p, struct indexes *indexes_p, struct timeval *timeout_p)
 
int(* bsm_handle )(struct ctx *ctx_p, struct indexes *indexes_p)
 
 return
 
static int bsm_prefetcher_running = 2
 

Macro Definition Documentation

◆ BSM_INIT_ERROR

#define BSM_INIT_ERROR
Value:
{\
free(ctx_p->fsmondata);\
ctx_p->fsmondata = NULL;\
return -1;\
}
ctx_t * ctx_p
Definition mon_kqueue.c:85
void * fsmondata
Definition ctx.h:419

Definition at line 297 of file mon_bsm.c.

◆ INFINITETIME

#define INFINITETIME   (3600 * 24 * 365 * 10) /* ~10 years */

Typedef Documentation

◆ bsm_handletype_t

Definition at line 557 of file mon_bsm.c.

◆ mondata_t

typedef struct mondata mondata_t

Definition at line 48 of file mon_bsm.c.

Enumeration Type Documentation

◆ bsm_handle_type

Enumerator
BSM_HANDLER_CALLWAIT 
BSM_HANDLER_ITERATE 

Definition at line 56 of file mon_bsm.c.

◆ bsm_handletype

Enumerator
BSM_HANDLE_CALLWAIT 
BSM_HANDLE_ITERATE 

Definition at line 553 of file mon_bsm.c.

◆ event_bits

enum event_bits
Enumerator
UEM_DIR 
UEM_CREATED 
UEM_DELETED 

Definition at line 50 of file mon_bsm.c.

Function Documentation

◆ auditd_restart()

int auditd_restart ( )

Definition at line 165 of file mon_bsm.c.

Here is the caller graph for this function:

◆ bsm_add_watch_dir()

int bsm_add_watch_dir ( struct ctx * ctx_p,
struct indexes * indexes_p,
const char *const accpath )

Definition at line 841 of file mon_bsm.c.

Here is the caller graph for this function:

◆ bsm_config_backup()

int bsm_config_backup ( mondata_t * mondata)

Definition at line 199 of file mon_bsm.c.

Here is the caller graph for this function:

◆ bsm_config_setup()

int bsm_config_setup ( mondata_t * mondata)

Definition at line 229 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_deinit()

int bsm_deinit ( ctx_t * ctx_p)

Definition at line 854 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_fetch()

int bsm_fetch ( ctx_t * ctx_p,
indexes_t * indexes_p,
struct bsm_event * event_p,
int pipe_fd,
struct timeval * timeout_p,
struct timeval * timeout_abs_p )

Definition at line 387 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_handle_allevents()

int bsm_handle_allevents ( struct ctx * ctx_p,
struct indexes * indexes_p,
bsm_handletype_t how )

Definition at line 558 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_handle_noprefetch()

int bsm_handle_noprefetch ( struct ctx * ctx_p,
struct indexes * indexes_p )
extern

Definition at line 836 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_handle_prefetched()

int bsm_handle_prefetched ( struct ctx * ctx_p,
struct indexes * indexes_p )
extern

Definition at line 795 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_init()

int bsm_init ( ctx_t * ctx_p)

Definition at line 303 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_prefetcher()

int bsm_prefetcher ( struct ctx * ctx_p)
extern

Definition at line 693 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_prefetcher_sig_int()

void bsm_prefetcher_sig_int ( int signal)

Definition at line 684 of file mon_bsm.c.

Here is the caller graph for this function:

◆ bsm_wait_noprefetch()

int bsm_wait_noprefetch ( struct ctx * ctx_p,
struct indexes * indexes_p,
struct timeval * timeout_p )
extern

Definition at line 804 of file mon_bsm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_wait_prefetched()

int bsm_wait_prefetched ( struct ctx * ctx_p,
struct indexes * indexes_p,
struct timeval * timeout_p )
extern

Definition at line 731 of file mon_bsm.c.

Here is the caller graph for this function:

◆ recognize_event()

static void recognize_event ( struct recognize_event_return * r,
uint32_t event )
inlinestatic

Definition at line 88 of file mon_bsm.c.

Here is the caller graph for this function:

◆ select_rfd()

int select_rfd ( int fd,
struct timeval * timeout_p )

Definition at line 375 of file mon_bsm.c.

Here is the caller graph for this function:

Variable Documentation

◆ bsm_cond_gotevent

pthread_cond_t bsm_cond_gotevent = PTHREAD_COND_INITIALIZER

Definition at line 74 of file mon_bsm.c.

◆ bsm_cond_queueend

pthread_cond_t bsm_cond_queueend = PTHREAD_COND_INITIALIZER

Definition at line 75 of file mon_bsm.c.

◆ bsm_handle

int(* bsm_handle) (struct ctx *ctx_p, struct indexes *indexes_p) ( struct ctx * ctx_p,
struct indexes * indexes_p )

Definition at line 80 of file mon_bsm.c.

◆ bsm_mutex_prefetcher

pthread_mutex_t bsm_mutex_prefetcher = PTHREAD_MUTEX_INITIALIZER

Definition at line 73 of file mon_bsm.c.

◆ bsm_prefetcher_running

int bsm_prefetcher_running = 2
static

Definition at line 692 of file mon_bsm.c.

◆ bsm_queue_len

int bsm_queue_len

Definition at line 77 of file mon_bsm.c.

◆ bsm_wait

int(* bsm_wait) (struct ctx *ctx_p, struct indexes *indexes_p, struct timeval *timeout_p) ( struct ctx * ctx_p,
struct indexes * indexes_p,
struct timeval * timeout_p )

Definition at line 79 of file mon_bsm.c.

◆ prefetcher_thread

pthread_t prefetcher_thread

Definition at line 72 of file mon_bsm.c.

◆ return

return

Definition at line 293 of file mon_bsm.c.