-
Notifications
You must be signed in to change notification settings - Fork 7
/
fscallwatch.h
50 lines (43 loc) · 1.12 KB
/
fscallwatch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @brief File Call Watch (FCW) API
* Copyright 2016-2018 Cisco Systems
* GNU Public License
*/
#ifndef FSCALLWATCH_H
#define FSCALLWATCH_H
#include "fsm.h"
/**
* @brief File operation callback. Called after a file-system sys call has been
* processed and all the information loaded into the amp_fsm_op_data_t
* struct.
*
* @param[in] data - File operation information
*/
typedef void (*fcw_op_cb_t)(fileop_data_t *data);
typedef struct {
fcw_op_cb_t op;
} fcw_cb_t;
/**
* @brief Register file-system sys call watchers (kprobes).
*
* @param[in] cb - pointer to a structure defining callbacks
* @param[in] filter - File operations to accept
*
* @return 0 if successful, or nonzero on error
*/
int fcw_init(fcw_cb_t *cb, amp_fsm_op_t filter);
/**
* @brief Unregister file-system sys call watchers.
*
* @return 0 if successful, or nonzero on error
*/
int fcw_deinit(void);
/**
* @brief Set file operation filter.
*
* @param[in] filter - File operations to accept
*
* @return 0 on success or -1 if file callwatcher is not initialized
*/
int fcw_set_filter(amp_fsm_op_t filter);
#endif