Skyld AV  0.6
On access virus scanning for Linux
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MountPolling.h
Go to the documentation of this file.
1 /*
2  * File: MountPolling.h
3  *
4  * Copyright 2012 Heinrich Schuchardt <xypron.glpk@gmx.de>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
23 #ifndef POLLMOUNTS_H
24 #define POLLMOUNTS_H
25 
26 #include <signal.h>
27 #include "StringSet.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 class MountPolling {
37 public:
38 
42  enum Status {
43  INITIAL = 0,
44  RUNNING = 1,
45  STOPPING = 2,
46  FAILURE = 3,
47  SUCCESS = 4
48  };
49 
53  typedef void (*callbackptr)();
54  MountPolling(int ffd, Environment *);
55  ~MountPolling();
56 private:
64  int fd;
77  static void *run(void *);
81  sig_atomic_t status;
82 
83  void callback();
84  int isFuse(const char *);
85 
86  // Do not allow copying.
87  MountPolling(const MountPolling&);
88 };
89 
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* POLLMOUNTS_H */
96 
static void * run(void *)
Thread listening to mount events.
Definition: MountPolling.cc:59
void(* callbackptr)()
Pointer to callback function for polling mounts.
Definition: MountPolling.h:53
int fd
Fanotify file descriptor.
Definition: MountPolling.h:64
Set of pointers to strings.
Definition: StringSet.h:56
Set of strings.
int isFuse(const char *)
Checks if a mount is using a filesystem in userspace (fuse).
void callback()
Tracks mountevents.
~MountPolling()
Deletes mount polling object.
MountPolling(int ffd, Environment *)
Status
Status that may occur.
Definition: MountPolling.h:42
Polls mount and unmout events.
Definition: MountPolling.h:36
StringSet * nomarkmnt
Mount points that shall not be tracked.
Definition: MountPolling.h:76
sig_atomic_t status
Status of thread.
Definition: MountPolling.h:81
StringSet * nomarkfs
File systems that shall not be tracked.
Definition: MountPolling.h:72
StringSet * mounts
Mounts.
Definition: MountPolling.h:68
The environment holds variables that are shared by instances of multiple classes. ...
Definition: Environment.h:38
Environment * env
Environment.
Definition: MountPolling.h:60