Skyld AV  0.6
On access virus scanning for Linux
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
MountPolling Class Reference

Polls mount and unmout events. More...

#include <MountPolling.h>

Collaboration diagram for MountPolling:
Collaboration graph

Public Types

enum  Status {
  INITIAL = 0, RUNNING = 1, STOPPING = 2, FAILURE = 3,
  SUCCESS = 4
}
 Status that may occur. More...
 
typedef void(* callbackptr )()
 Pointer to callback function for polling mounts. More...
 

Public Member Functions

 MountPolling (int ffd, Environment *)
 
 ~MountPolling ()
 Deletes mount polling object. More...
 

Private Member Functions

void callback ()
 Tracks mountevents. More...
 
int isFuse (const char *)
 Checks if a mount is using a filesystem in userspace (fuse). More...
 
 MountPolling (const MountPolling &)
 

Static Private Member Functions

static void * run (void *)
 Thread listening to mount events. More...
 

Private Attributes

Environmentenv
 Environment. More...
 
int fd
 Fanotify file descriptor. More...
 
StringSetmounts
 Mounts. More...
 
StringSetnomarkfs
 File systems that shall not be tracked. More...
 
StringSetnomarkmnt
 Mount points that shall not be tracked. More...
 
sig_atomic_t status
 Status of thread. More...
 

Detailed Description

Polls mount and unmout events.

Definition at line 36 of file MountPolling.h.

Member Typedef Documentation

typedef void(* MountPolling::callbackptr)()

Pointer to callback function for polling mounts.

Definition at line 53 of file MountPolling.h.

Member Enumeration Documentation

Status that may occur.

Enumerator
INITIAL 
RUNNING 
STOPPING 
FAILURE 
SUCCESS 

Definition at line 42 of file MountPolling.h.

Constructor & Destructor Documentation

MountPolling::MountPolling ( int  ffd,
Environment e 
)

Creates new mount polling object.

Parameters
nomarkfs
nomarkmnt

Definition at line 196 of file MountPolling.cc.

Here is the call graph for this function:

MountPolling::~MountPolling ( )

Deletes mount polling object.

Definition at line 246 of file MountPolling.cc.

Here is the call graph for this function:

MountPolling::MountPolling ( const MountPolling )
private

Member Function Documentation

void MountPolling::callback ( )
private

Tracks mountevents.

Definition at line 126 of file MountPolling.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int MountPolling::isFuse ( const char *  type)
private

Checks if a mount is using a filesystem in userspace (fuse).

Parameters
typemount type
Returns
1 if mount type is "fuse" or starts with "fuse.".

Definition at line 178 of file MountPolling.cc.

Here is the caller graph for this function:

void * MountPolling::run ( void *  obj)
staticprivate

Thread listening to mount events.

Parameters
ccbptrpointer to callback routine
Returns
pointer to int indicating success

set of file descriptors to be monitored.

number of file descriptors.

buffer for strerror_r.

Definition at line 59 of file MountPolling.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Environment* MountPolling::env
private

Environment.

Definition at line 60 of file MountPolling.h.

int MountPolling::fd
private

Fanotify file descriptor.

Definition at line 64 of file MountPolling.h.

StringSet* MountPolling::mounts
private

Mounts.

Definition at line 68 of file MountPolling.h.

StringSet* MountPolling::nomarkfs
private

File systems that shall not be tracked.

Definition at line 72 of file MountPolling.h.

StringSet* MountPolling::nomarkmnt
private

Mount points that shall not be tracked.

Definition at line 76 of file MountPolling.h.

sig_atomic_t MountPolling::status
private

Status of thread.

Definition at line 81 of file MountPolling.h.


The documentation for this class was generated from the following files: