forked from jcnelson/vdev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
67 lines (48 loc) · 1.99 KB
/
config.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
vdev: a virtual device manager for *nix
Copyright (C) 2014 Jude Nelson
This program is dual-licensed: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 or later as
published by the Free Software Foundation. For the terms of this
license, see LICENSE.LGPLv3+ or <http://www.gnu.org/licenses/>.
You are free to use this program under the terms of the GNU General
Public License, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
Alternatively, you are free to use this program under the terms of the
Internet Software Consortium License, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
For the terms of this license, see LICENSE.ISC or
<http://www.isc.org/downloads/software-support-policy/isc-license/>.
*/
#ifndef _VDEV_CONFIG_H_
#define _VDEV_CONFIG_H_
#include "fskit/fskit.h"
#include "util.h"
#define VDEV_CONFIG_NAME "vdev-config"
#define VDEV_OS_CONFIG_NAME "vdev-OS"
#define VDEV_CONFIG_FIRMWARE_DIR "firmware"
#define VDEV_CONFIG_PSTAT "proc_check"
#define VDEV_CONFIG_ACLS "acls"
#define VDEV_CONFIG_ACTIONS "actions"
#define VDEV_CONFIG_NAME_PSTAT_HASH "hash"
typedef map<string, string> vdev_config_map_t;
struct vdev_config {
// firmware directory
char* firmware_dir;
// ACLs directory
char* acls_dir;
// actions directory
char* acts_dir;
// process stat discipline
int pstat_discipline;
// OS-specific configuration (for keys under "OS")
vdev_config_map_t* os_config;
};
extern "C" {
int vdev_config_init( struct vdev_config* conf );
int vdev_config_load( char const* path, struct vdev_config* conf );
int vdev_config_load_file( FILE* file, struct vdev_config* conf );
int vdev_config_free( struct vdev_config* conf );
};
#endif